Refactor quick create antag panel code, fixed AFK revs not properly ending the round. (#31103)

* Refactor quick create antag, fixed AFK revs not ending

* More cleanup

* Simplified one of the checks
The other half was covered by considered_alive already.

* Reordered check

Eliminate current antags sooner before running them through the rest of
the checks.

* removed switch
This commit is contained in:
ShizCalev
2017-10-02 02:48:51 -05:00
committed by CitadelStationBot
parent 52369cdb7c
commit e402c4350c
4 changed files with 59 additions and 55 deletions
+14
View File
@@ -331,6 +331,20 @@
afk_bracket += 600 // Add a minute to the bracket, for every attempt
return candidates
/proc/considered_alive(datum/mind/M, enforce_human = TRUE)
if(M && M.current)
if(enforce_human)
var/mob/living/carbon/human/H
if(ishuman(M.current))
H = M.current
return M.current.stat != DEAD && !issilicon(M.current) && !isbrain(M.current) && (!H || H.dna.species.id != "memezombies")
else if(isliving(M.current))
return M.current.stat != DEAD
return FALSE
/proc/considered_afk(datum/mind/M)
return !M || !M.current || !M.current.client || M.current.client.is_afk()
/proc/ScreenText(obj/O, maptext="", screen_loc="CENTER-7,CENTER-7", maptext_height=480, maptext_width=480)
if(!isobj(O))
O = new /obj/screen/text()