Merge pull request #11298 from Kyep/ban_fix

Fixes bans not saving properly
This commit is contained in:
variableundefined
2019-04-16 19:45:32 +08:00
committed by GitHub
2 changed files with 8 additions and 11 deletions
+5
View File
@@ -70,6 +70,11 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
if(banned_mob.client)
computerid = banned_mob.client.computer_id
ip = banned_mob.client.address
else
if(banned_mob.lastKnownIP)
ip = banned_mob.lastKnownIP
if(banned_mob.computer_id)
computerid = banned_mob.computer_id
else if(banckey)
ckey = ckey(banckey)
computerid = bancid
+3 -11
View File
@@ -1005,15 +1005,7 @@
var/reason = input(usr,"Please state the reason","Reason") as message|null
if(!reason)
return
switch(alert(usr,"IP ban?",,"Yes","No","Cancel"))
if("Cancel")
return
if("Yes")
M = admin_ban_mobsearch(M, ban_ckey_param, usr)
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP)
if("No")
M = admin_ban_mobsearch(M, ban_ckey_param, usr)
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0)
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP)
to_chat(M, "<span class='warning'><BIG><B>You have been banned by [usr.client.ckey].\nReason: [reason].</B></BIG></span>")
to_chat(M, "<span class='warning'>This is a permanent ban.</span>")
if(config.banappeals)
@@ -1553,12 +1545,12 @@
else if(href_list["take_question"])
var/index = text2num(href_list["take_question"])
if(href_list["is_mhelp"])
SSmentor_tickets.takeTicket(index)
else //Ahelp
SStickets.takeTicket(index)
else if(href_list["cult_nextobj"])
if(alert(usr, "Validate the current Cult objective and unlock the next one?", "Cult Cheat Code", "Yes", "No") != "Yes")
return