Replaces a bunch of mob loops with hopefully better ones

This commit is contained in:
vuonojenmustaturska
2017-11-16 16:09:15 -06:00
committed by CitadelStationBot
parent 0e0eb351b3
commit 6ce69fb2c8
84 changed files with 405 additions and 154 deletions
+6 -3
View File
@@ -232,7 +232,7 @@ Turf and target are separate in case you want to teleport some distance from a t
//Returns a list of unslaved cyborgs
/proc/active_free_borgs()
. = list()
for(var/mob/living/silicon/robot/R in GLOB.living_mob_list)
for(var/mob/living/silicon/robot/R in GLOB.alive_mob_list)
if(R.connected_ai || R.shell)
continue
if(R.stat == DEAD)
@@ -244,7 +244,7 @@ Turf and target are separate in case you want to teleport some distance from a t
//Returns a list of AI's
/proc/active_ais(check_mind=0)
. = list()
for(var/mob/living/silicon/ai/A in GLOB.living_mob_list)
for(var/mob/living/silicon/ai/A in GLOB.alive_mob_list)
if(A.stat == DEAD)
continue
if(A.control_disabled == 1)
@@ -920,7 +920,7 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list(
/proc/living_player_count()
var/living_player_count = 0
for(var/mob in GLOB.player_list)
if(mob in GLOB.living_mob_list)
if(mob in GLOB.alive_mob_list)
living_player_count += 1
return living_player_count
@@ -1357,6 +1357,9 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
anchored = TRUE
var/ready_to_die = FALSE
/mob/dview/Initialize() //Properly prevents this mob from gaining huds or joining any global lists
return
/mob/dview/Destroy(force = FALSE)
if(!ready_to_die)
stack_trace("ALRIGHT WHICH FUCKER TRIED TO DELETE *MY* DVIEW?")