Merge pull request #15343 from SandPoot/deadmin-prefs
Ports Automatic Deadminning from TG
This commit is contained in:
@@ -121,6 +121,9 @@ INITIALIZE_IMMEDIATE(/mob/dead)
|
||||
if (isturf(T))
|
||||
update_z(T.z)
|
||||
|
||||
/mob/dead/auto_deadmin_on_login()
|
||||
return
|
||||
|
||||
/mob/dead/Logout()
|
||||
update_z(null)
|
||||
return ..()
|
||||
|
||||
@@ -11,3 +11,10 @@
|
||||
if(G)
|
||||
mind.remove_antag_datum(G)
|
||||
..()
|
||||
|
||||
/mob/living/silicon/auto_deadmin_on_login()
|
||||
if(!client?.holder)
|
||||
return TRUE
|
||||
if(CONFIG_GET(flag/auto_deadmin_silicons) || (client.prefs?.deadmin & DEADMIN_POSITION_SILICON))
|
||||
return client.holder.auto_deadmin()
|
||||
return ..()
|
||||
|
||||
@@ -140,6 +140,12 @@
|
||||
if(!picked)
|
||||
pickVisualAppearence()
|
||||
|
||||
/mob/living/simple_animal/drone/auto_deadmin_on_login()
|
||||
if(!client?.holder)
|
||||
return TRUE
|
||||
if(CONFIG_GET(flag/auto_deadmin_silicons) || (client.prefs?.deadmin & DEADMIN_POSITION_SILICON))
|
||||
return client.holder.auto_deadmin()
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/drone/death(gibbed)
|
||||
..(gibbed)
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
for(var/foo in client.player_details.post_login_callbacks)
|
||||
var/datum/callback/CB = foo
|
||||
CB.Invoke()
|
||||
auto_deadmin_on_login()
|
||||
|
||||
mind?.hide_ckey = client?.prefs?.hide_ckey
|
||||
|
||||
@@ -96,3 +97,13 @@
|
||||
|
||||
// optimized area sound effects. Enable during events (compile flag when 😳)
|
||||
// AddElement(/datum/element/weather_listener, /datum/weather/long_rain, ZTRAIT_STATION, GLOB.rain_sounds)
|
||||
|
||||
/mob/proc/auto_deadmin_on_login() //return true if they're not an admin at the end.
|
||||
if(!client?.holder)
|
||||
return TRUE
|
||||
if(CONFIG_GET(flag/auto_deadmin_players) || (client.prefs?.deadmin & DEADMIN_ALWAYS))
|
||||
return client.holder.auto_deadmin()
|
||||
if(mind.has_antag_datum(/datum/antagonist) && (CONFIG_GET(flag/auto_deadmin_antagonists) || client.prefs?.deadmin & DEADMIN_ANTAGONIST))
|
||||
return client.holder.auto_deadmin()
|
||||
if(job)
|
||||
return SSjob.handle_auto_deadmin_roles(client, job)
|
||||
|
||||
Reference in New Issue
Block a user