Replaces a bunch of mob loops with hopefully better ones
This commit is contained in:
committed by
CitadelStationBot
parent
0e0eb351b3
commit
6ce69fb2c8
@@ -575,7 +575,7 @@ SUBSYSTEM_DEF(job)
|
||||
///////////////////////////////////
|
||||
/datum/controller/subsystem/job/proc/get_living_heads()
|
||||
. = list()
|
||||
for(var/mob/living/carbon/human/player in GLOB.mob_list)
|
||||
for(var/mob/living/carbon/human/player in GLOB.alive_mob_list)
|
||||
if(player.stat != DEAD && player.mind && (player.mind.assigned_role in GLOB.command_positions))
|
||||
. |= player.mind
|
||||
|
||||
@@ -585,7 +585,8 @@ SUBSYSTEM_DEF(job)
|
||||
////////////////////////////
|
||||
/datum/controller/subsystem/job/proc/get_all_heads()
|
||||
. = list()
|
||||
for(var/mob/player in GLOB.mob_list)
|
||||
for(var/i in GLOB.mob_list)
|
||||
var/mob/player = i
|
||||
if(player.mind && (player.mind.assigned_role in GLOB.command_positions))
|
||||
. |= player.mind
|
||||
|
||||
@@ -594,7 +595,7 @@ SUBSYSTEM_DEF(job)
|
||||
//////////////////////////////////////////////
|
||||
/datum/controller/subsystem/job/proc/get_living_sec()
|
||||
. = list()
|
||||
for(var/mob/living/carbon/human/player in GLOB.mob_list)
|
||||
for(var/mob/living/carbon/human/player in GLOB.carbon_list)
|
||||
if(player.stat != DEAD && player.mind && (player.mind.assigned_role in GLOB.security_positions))
|
||||
. |= player.mind
|
||||
|
||||
@@ -603,6 +604,6 @@ SUBSYSTEM_DEF(job)
|
||||
////////////////////////////////////////
|
||||
/datum/controller/subsystem/job/proc/get_all_sec()
|
||||
. = list()
|
||||
for(var/mob/living/carbon/human/player in GLOB.mob_list)
|
||||
for(var/mob/living/carbon/human/player in GLOB.carbon_list)
|
||||
if(player.mind && (player.mind.assigned_role in GLOB.security_positions))
|
||||
. |= player.mind
|
||||
. |= player.mind
|
||||
|
||||
@@ -7,13 +7,15 @@ SUBSYSTEM_DEF(mobs)
|
||||
var/list/currentrun = list()
|
||||
|
||||
/datum/controller/subsystem/mobs/stat_entry()
|
||||
..("P:[GLOB.mob_list.len]")
|
||||
..("P:[GLOB.mob_living_list.len]")
|
||||
|
||||
|
||||
/datum/controller/subsystem/mobs/fire(resumed = 0)
|
||||
var/seconds = wait * 0.1
|
||||
if (!resumed)
|
||||
src.currentrun = GLOB.mob_list.Copy()
|
||||
src.currentrun = GLOB.mob_living_list.Copy()
|
||||
if (GLOB.overminds.len) // blob cameras need to Life()
|
||||
src.currentrun += GLOB.overminds
|
||||
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
@@ -24,6 +26,6 @@ SUBSYSTEM_DEF(mobs)
|
||||
if(M)
|
||||
M.Life(seconds, times_fired)
|
||||
else
|
||||
GLOB.mob_list.Remove(M)
|
||||
GLOB.mob_living_list.Remove(M)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
@@ -73,7 +73,7 @@ SUBSYSTEM_DEF(persistence)
|
||||
break
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/LoadPoly()
|
||||
for(var/mob/living/simple_animal/parrot/Poly/P in GLOB.living_mob_list)
|
||||
for(var/mob/living/simple_animal/parrot/Poly/P in GLOB.alive_mob_list)
|
||||
twitterize(P.speech_buffer, "polytalk")
|
||||
break //Who's been duping the bird?!
|
||||
|
||||
|
||||
@@ -416,7 +416,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
C.playtitlemusic(40)*/
|
||||
|
||||
//Player status report
|
||||
for(var/mob/Player in GLOB.mob_list)
|
||||
for(var/i in GLOB.mob_list)
|
||||
var/mob/Player = i
|
||||
if(Player.mind && !isnewplayer(Player))
|
||||
if(Player.stat != DEAD && !isbrain(Player))
|
||||
num_survivors++
|
||||
@@ -462,7 +463,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
CHECK_TICK
|
||||
|
||||
//Silicon laws report
|
||||
for (var/mob/living/silicon/ai/aiPlayer in GLOB.mob_list)
|
||||
for (var/i in GLOB.ai_list)
|
||||
var/mob/living/silicon/ai/aiPlayer = i
|
||||
if (aiPlayer.stat != DEAD && aiPlayer.mind)
|
||||
to_chat(world, "<b>[aiPlayer.name] (Played by: [aiPlayer.mind.key])'s laws at the end of the round were:</b>")
|
||||
aiPlayer.show_laws(1)
|
||||
@@ -481,7 +483,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
for (var/mob/living/silicon/robot/robo in GLOB.mob_list)
|
||||
for (var/mob/living/silicon/robot/robo in GLOB.silicon_mobs)
|
||||
if (!robo.connected_ai && robo.mind)
|
||||
if (robo.stat != DEAD)
|
||||
to_chat(world, "<b>[robo.name] (Played by: [robo.mind.key]) survived as an AI-less borg! Its laws were:</b>")
|
||||
|
||||
@@ -13,7 +13,8 @@ SUBSYSTEM_DEF(weather)
|
||||
var/datum/weather/W = V
|
||||
if(W.aesthetic)
|
||||
continue
|
||||
for(var/mob/living/L in GLOB.mob_list)
|
||||
for(var/i in GLOB.mob_living_list)
|
||||
var/mob/living/L = i
|
||||
if(W.can_weather_act(L))
|
||||
W.weather_act(L)
|
||||
for(var/Z in eligible_zlevels)
|
||||
|
||||
Reference in New Issue
Block a user