Replaces a bunch of mob loops with hopefully better ones
This commit is contained in:
committed by
CitadelStationBot
parent
0e0eb351b3
commit
6ce69fb2c8
@@ -77,7 +77,7 @@
|
||||
|
||||
/proc/alone_in_area(area/the_area, mob/must_be_alone, check_type = /mob/living/carbon)
|
||||
var/area/our_area = get_area(the_area)
|
||||
for(var/C in GLOB.living_mob_list)
|
||||
for(var/C in GLOB.alive_mob_list)
|
||||
if(!istype(C, check_type))
|
||||
continue
|
||||
if(C == must_be_alone)
|
||||
@@ -318,7 +318,8 @@
|
||||
break
|
||||
|
||||
/proc/get_mob_by_key(key)
|
||||
for(var/mob/M in GLOB.mob_list)
|
||||
for(var/i in GLOB.player_list)
|
||||
var/mob/M = i
|
||||
if(M.ckey == lowertext(key))
|
||||
return M
|
||||
return null
|
||||
|
||||
@@ -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?")
|
||||
|
||||
Reference in New Issue
Block a user