Deadmin tweaks: Admins without +AUTOLOGIN start deadmined. AUTOLOGIN defaults to on.

This commit is contained in:
Kyle Spier-Swenson
2017-12-13 19:03:37 -08:00
committed by CitadelStationBot
parent b11d1c024e
commit 55247e9bdf
11 changed files with 178 additions and 100 deletions

View File

@@ -638,12 +638,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
if(has_antag_hud())
toggle_antag_hud()
holder.disassociate()
qdel(holder)
GLOB.deadmins += ckey
GLOB.admin_datums -= ckey
verbs += /client/proc/readmin
holder.deactivate()
to_chat(src, "<span class='interface'>You are now a normal player.</span>")
log_admin("[src] deadmined themself.")
@@ -655,13 +650,20 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
set category = "Admin"
set desc = "Regain your admin powers."
load_admins(ckey)
var/datum/admins/A = GLOB.deadmins[ckey]
if(!holder) // Something went wrong...
return
if(!A)
A = GLOB.admin_datums[ckey]
if (!A)
var/msg = " is trying to readmin but they have no deadmin entry"
message_admins("[key_name_admin(src)][msg]")
log_admin_private("[key_name(src)][msg]")
return
GLOB.deadmins -= ckey
verbs -= /client/proc/readmin
A.associate(src)
if (!holder)
return //This can happen if an admin attempts to vv themself into somebody elses's deadmin datum by getting ref via brute force
to_chat(src, "<span class='interface'>You are now an admin.</span>")
message_admins("[src] re-adminned themselves.")