From 39375d5cc2cd6b3d5aadf73ee0b1591621c0ecb3 Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Fri, 17 Nov 2017 00:08:40 +0200 Subject: [PATCH] Replaces a bunch of mob loops with hopefully better ones (#32786) * Free codebase churn * fixes dviewmob * a commit * Partial revert "Free codebase churn" This reverts commit 9dd41b3860c331637bbc85e694dd32dc59768ad5. * better fix to dviewmob * renames living_mob_list to alive_mob_list, adds mob_living_list and carbon_list * make some use out of the shiny carbon list * make some use out of the shiny new living list * more things, also make the mobs subsystem (Life) use living list * bonus * domo arigato mr. roboto * compile fixes, also made the drone code less dumb * better? * make admin message prettier * honk * fixes blobs * rev fixes * one small thing --- code/__HELPERS/game.dm | 5 ++-- code/__HELPERS/unsorted.dm | 9 +++++--- code/_globalvars/lists/mobs.dm | 4 +++- code/_onclick/hud/alert.dm | 2 +- code/controllers/subsystem/job.dm | 11 +++++---- code/controllers/subsystem/mobs.dm | 8 ++++--- code/controllers/subsystem/persistence.dm | 2 +- code/controllers/subsystem/ticker.dm | 8 ++++--- code/controllers/subsystem/weather.dm | 3 ++- code/datums/diseases/advance/advance.dm | 2 +- code/game/area/areas.dm | 3 ++- code/game/gamemodes/blob/overmind.dm | 3 ++- .../gamemodes/changeling/powers/linglink.dm | 3 ++- .../clock_effects/spatial_gateway.dm | 2 +- .../clock_scriptures/scripture_scripts.dm | 2 +- .../clock_structures/heralds_beacon.dm | 2 +- .../ratvar_the_clockwork_justicar.dm | 2 +- code/game/gamemodes/cult/cult_comms.dm | 3 ++- code/game/gamemodes/game_mode.dm | 23 +++++++------------ .../gamemodes/malfunction/Malf_Modules.dm | 5 ++-- .../gamemodes/miniantags/bot_swarm/swarmer.dm | 3 ++- .../miniantags/bot_swarm/swarmer_event.dm | 5 ++-- .../gamemodes/miniantags/monkey/monkey.dm | 4 ++-- code/game/gamemodes/revolution/revolution.dm | 2 +- code/game/gamemodes/wizard/artefact.dm | 2 +- code/game/machinery/camera/camera.dm | 11 +++++---- code/game/machinery/camera/motion.dm | 5 ++-- code/game/machinery/camera/tracking.dm | 18 ++++++--------- code/game/machinery/computer/crew.dm | 2 +- code/game/machinery/computer/medical.dm | 2 +- code/game/machinery/computer/robot.dm | 4 ++-- code/game/machinery/computer/security.dm | 2 +- code/game/objects/effects/manifest.dm | 2 +- code/game/objects/items/devices/PDA/cart.dm | 4 ++-- code/game/objects/items/pinpointer.dm | 3 +-- code/modules/admin/admin.dm | 3 ++- code/modules/admin/secrets.dm | 12 +++++----- code/modules/admin/verbs/debug.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 4 ++-- .../awaymissions/mission_code/wildwest.dm | 4 ++-- code/modules/events/disease_outbreak.dm | 2 +- code/modules/events/holiday/halloween.dm | 6 ++--- code/modules/events/holiday/vday.dm | 2 +- code/modules/events/holiday/xmas.dm | 2 +- code/modules/events/ion_storm.dm | 4 ++-- code/modules/events/mass_hallucination.dm | 2 +- code/modules/events/sentience.dm | 2 +- .../events/spontaneous_appendicitis.dm | 2 +- code/modules/events/wizard/aid.dm | 6 +++-- code/modules/events/wizard/curseditems.dm | 4 ++-- .../modules/events/wizard/departmentrevolt.dm | 2 +- code/modules/events/wizard/greentext.dm | 3 ++- code/modules/events/wizard/invincible.dm | 2 +- code/modules/events/wizard/petsplosion.dm | 4 ++-- code/modules/events/wizard/race.dm | 2 +- code/modules/events/wizard/shuffle.dm | 12 +++++----- code/modules/flufftext/Hallucination.dm | 6 ++--- code/modules/mob/dead/observer/observer.dm | 2 +- code/modules/mob/living/brain/MMI.dm | 4 ++-- code/modules/mob/living/brain/posibrain.dm | 2 +- code/modules/mob/living/carbon/alien/alien.dm | 9 ++++---- .../mob/living/carbon/alien/humanoid/death.dm | 2 +- .../living/carbon/alien/humanoid/humanoid.dm | 2 +- .../mob/living/carbon/alien/humanoid/queen.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 2 ++ code/modules/mob/living/death.dm | 2 +- code/modules/mob/living/living.dm | 4 +++- code/modules/mob/living/silicon/ai/ai.dm | 6 ++--- code/modules/mob/living/silicon/pai/death.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 2 +- .../simple_animal/friendly/drone/say.dm | 20 ++++++++-------- .../friendly/drone/visuals_icons.dm | 3 ++- .../hostile/megafauna/bubblegum.dm | 4 ++-- .../simple_animal/hostile/megafauna/legion.dm | 2 +- .../hostile/mining_mobs/necropolis_tendril.dm | 2 +- .../living/simple_animal/hostile/statue.dm | 2 +- code/modules/mob/mob.dm | 8 +++---- code/modules/mob/mob_helpers.dm | 3 ++- code/modules/power/gravitygenerator.dm | 3 ++- code/modules/power/singularity/narsie.dm | 2 +- code/modules/power/supermatter/supermatter.dm | 6 ++--- code/modules/research/experimentor.dm | 4 ++-- code/modules/shuttle/arrivals.dm | 2 +- code/modules/surgery/organs/tongue.dm | 2 +- 84 files changed, 193 insertions(+), 170 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 39960e46b8ad..7af9bf22805f 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -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 diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 86dcc1a3f1ad..a8272a439932 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -234,7 +234,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) @@ -246,7 +246,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) @@ -922,7 +922,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 @@ -1359,6 +1359,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?") diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index b2bb53c196ff..a207ffc04bf6 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -12,11 +12,13 @@ GLOBAL_LIST_EMPTY(stealthminID) //reference list with IDs that store ckeys, GLOBAL_LIST_EMPTY(player_list) //all mobs **with clients attached**. Excludes /mob/dead/new_player GLOBAL_LIST_EMPTY(mob_list) //all mobs, including clientless GLOBAL_LIST_EMPTY(mob_directory) //mob_id -> mob -GLOBAL_LIST_EMPTY(living_mob_list) //all alive mobs, including clientless. Excludes /mob/dead/new_player +GLOBAL_LIST_EMPTY(alive_mob_list) //all alive mobs, including clientless. Excludes /mob/dead/new_player GLOBAL_LIST_EMPTY(drones_list) GLOBAL_LIST_EMPTY(dead_mob_list) //all dead mobs, including clientless. Excludes /mob/dead/new_player GLOBAL_LIST_EMPTY(joined_player_list) //all clients that have joined the game at round-start or as a latejoin. GLOBAL_LIST_EMPTY(silicon_mobs) //all silicon mobs +GLOBAL_LIST_EMPTY(mob_living_list) //all instances of /mob/living and subtypes +GLOBAL_LIST_EMPTY(carbon_list) //all instances of /mob/living/carbon and subtypes, notably does not contain brains or simple animals GLOBAL_LIST_EMPTY(ai_list) GLOBAL_LIST_EMPTY(pai_list) GLOBAL_LIST_EMPTY(available_ai_shells) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 93383c2c4936..da2fae9882c2 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -390,7 +390,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." var/servants = 0 var/validservants = 0 var/list/textlist - for(var/mob/living/L in GLOB.living_mob_list) + for(var/mob/living/L in GLOB.alive_mob_list) if(is_servant_of_ratvar(L)) servants++ if(ishuman(L) || issilicon(L)) diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index 6250f688b785..dff38a87c6f6 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -563,7 +563,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 @@ -573,7 +573,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 @@ -582,7 +583,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 @@ -591,6 +592,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 \ No newline at end of file + . |= player.mind diff --git a/code/controllers/subsystem/mobs.dm b/code/controllers/subsystem/mobs.dm index cbe9d5c2450d..1311ca158960 100644 --- a/code/controllers/subsystem/mobs.dm +++ b/code/controllers/subsystem/mobs.dm @@ -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 diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm index 1feaea19f347..b98be937fca3 100644 --- a/code/controllers/subsystem/persistence.dm +++ b/code/controllers/subsystem/persistence.dm @@ -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?! diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 0172183e78ff..4563e4863f94 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -388,7 +388,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++ @@ -434,7 +435,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, "[aiPlayer.name] (Played by: [aiPlayer.mind.key])'s laws at the end of the round were:") aiPlayer.show_laws(1) @@ -453,7 +455,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, "[robo.name] (Played by: [robo.mind.key]) survived as an AI-less borg! Its laws were:") diff --git a/code/controllers/subsystem/weather.dm b/code/controllers/subsystem/weather.dm index e66fd4ffeb18..2909d1c70a0c 100644 --- a/code/controllers/subsystem/weather.dm +++ b/code/controllers/subsystem/weather.dm @@ -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) diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 1070039f0c4e..bbe98ff18d79 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -416,7 +416,7 @@ for(var/datum/disease/advance/AD in SSdisease.active_diseases) AD.Refresh() - for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list)) + for(var/mob/living/carbon/human/H in shuffle(GLOB.alive_mob_list)) if(!(H.z in GLOB.station_z_levels)) continue if(!H.HasDisease(D)) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index ff33f8e32aaa..17f75fc336e5 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -326,7 +326,8 @@ GLOBAL_LIST_EMPTY(teleportlocs) var/obj/machinery/camera/C = item cameras += C - for (var/mob/living/silicon/SILICON in GLOB.player_list) + for (var/i in GLOB.silicon_mobs) + var/mob/living/silicon/SILICON = i if(SILICON.triggerAlarm("Burglar", src, cameras, trigger)) //Cancel silicon alert after 1 minute addtimer(CALLBACK(SILICON, /mob/living/silicon.proc/cancelAlarm,"Burglar",src,trigger), 600) diff --git a/code/game/gamemodes/blob/overmind.dm b/code/game/gamemodes/blob/overmind.dm index 44775ae97615..4f26563da10b 100644 --- a/code/game/gamemodes/blob/overmind.dm +++ b/code/game/gamemodes/blob/overmind.dm @@ -79,7 +79,8 @@ GLOBAL_LIST_EMPTY(blob_nodes) /mob/camera/blob/proc/victory() sound_to_playing_players('sound/machines/alarm.ogg') sleep(100) - for(var/mob/living/L in GLOB.mob_list) + for(var/i in GLOB.mob_living_list) + var/mob/living/L = i var/turf/T = get_turf(L) if(!T || !(T.z in GLOB.station_z_levels)) continue diff --git a/code/game/gamemodes/changeling/powers/linglink.dm b/code/game/gamemodes/changeling/powers/linglink.dm index 7a933067859d..c129f035a290 100644 --- a/code/game/gamemodes/changeling/powers/linglink.dm +++ b/code/game/gamemodes/changeling/powers/linglink.dm @@ -48,7 +48,8 @@ if(3) to_chat(user, "We mold the [target]'s mind like clay, granting [target.p_them()] the ability to speak in the hivemind!") to_chat(target, "A migraine throbs behind your eyes, you hear yourself screaming - but your mouth has not opened!") - for(var/mob/M in GLOB.mob_list) + for(var/mi in GLOB.mob_list) + var/mob/M = mi if(M.lingcheck() == 2) to_chat(M, "We can sense a foreign presence in the hivemind...") target.mind.linglink = 1 diff --git a/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm b/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm index 4788f014d65c..a438f64448c0 100644 --- a/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm +++ b/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm @@ -162,7 +162,7 @@ var/locname = initial(A.name) possible_targets[avoid_assoc_duplicate_keys("[locname] [O.name]", teleportnames)] = O - for(var/mob/living/L in GLOB.living_mob_list) + for(var/mob/living/L in GLOB.alive_mob_list) if(!L.stat && is_servant_of_ratvar(L) && !L.Adjacent(invoker) && (L.z <= ZLEVEL_SPACEMAX)) //People right next to the invoker can't be portaled to, for obvious reasons possible_targets[avoid_assoc_duplicate_keys("[L.name] ([L.real_name])", teleportnames)] = L diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_scripts.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_scripts.dm index 16a6f3ffd7aa..a172f4ca4179 100644 --- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_scripts.dm +++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_scripts.dm @@ -322,7 +322,7 @@ to_chat(invoker, "You must not be inside an object to use this scripture!") return FALSE var/other_servants = 0 - for(var/mob/living/L in GLOB.living_mob_list) + for(var/mob/living/L in GLOB.alive_mob_list) if(is_servant_of_ratvar(L) && !L.stat && L != invoker) other_servants++ for(var/obj/structure/destructible/clockwork/powered/clockwork_obelisk/O in GLOB.all_clockwork_objects) diff --git a/code/game/gamemodes/clock_cult/clock_structures/heralds_beacon.dm b/code/game/gamemodes/clock_cult/clock_structures/heralds_beacon.dm index a1c75ed3da9a..9f18ff1669d0 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/heralds_beacon.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/heralds_beacon.dm @@ -100,7 +100,7 @@ continue C.update_values() to_chat(C, C.empower_string) - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) if(is_servant_of_ratvar(H)) to_chat(H, "The beacon's power warps your body into a clockwork form! You are now immune to many hazards, and your body is more robust against damage!") H.set_species(/datum/species/golem/clockwork/no_scrap) diff --git a/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm b/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm index 4850b904c830..b069e5545469 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm @@ -67,7 +67,7 @@ T.ratvar_act(TRUE) var/dir_to_step_in = pick(GLOB.cardinals) var/list/meals = list() - for(var/mob/living/L in GLOB.living_mob_list) //we want to know who's alive so we don't lose and retarget a single person + for(var/mob/living/L in GLOB.alive_mob_list) //we want to know who's alive so we don't lose and retarget a single person if(L.z == z && !is_servant_of_ratvar(L) && L.mind) meals += L if(GLOB.cult_narsie && GLOB.cult_narsie.z == z) diff --git a/code/game/gamemodes/cult/cult_comms.dm b/code/game/gamemodes/cult/cult_comms.dm index b8cbed505123..530b6ebb2087 100644 --- a/code/game/gamemodes/cult/cult_comms.dm +++ b/code/game/gamemodes/cult/cult_comms.dm @@ -40,7 +40,8 @@ else if(!ishuman(user)) title = "Construct" my_message = "[title] [findtextEx(user.name, user.real_name) ? user.name : "[user.real_name] (as [user.name])"]: [message]" - for(var/mob/M in GLOB.mob_list) + for(var/i in GLOB.player_list) + var/mob/M = i if(iscultist(M)) to_chat(M, my_message) else if(M in GLOB.dead_mob_list) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 7909b0677f76..0d49a2504192 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -217,7 +217,7 @@ if(living_antag_player && living_antag_player.mind && isliving(living_antag_player) && living_antag_player.stat != DEAD && !isnewplayer(living_antag_player) &&!isbrain(living_antag_player)) return 0 //A resource saver: once we find someone who has to die for all antags to be dead, we can just keep checking them, cycling over everyone only when we lose our mark. - for(var/mob/Player in GLOB.living_mob_list) + for(var/mob/Player in GLOB.alive_mob_list) if(Player.mind && Player.stat != DEAD && !isnewplayer(Player) &&!isbrain(Player) && Player.client) if(Player.mind.special_role || LAZYLEN(Player.mind.antag_datums)) //Someone's still antaging! living_antag_player = Player @@ -407,16 +407,11 @@ ////////////////////////// /proc/display_roundstart_logout_report() var/msg = "Roundstart logout report\n\n" - for(var/mob/living/L in GLOB.mob_list) + for(var/i in GLOB.mob_living_list) + var/mob/living/L = i - if(L.ckey) - var/found = 0 - for(var/client/C in GLOB.clients) - if(C.ckey == L.ckey) - found = 1 - break - if(!found) - msg += "[L.name] ([L.ckey]), the [L.job] (Disconnected)\n" + if(L.ckey && !GLOB.directory[L.ckey]) + msg += "[L.name] ([L.ckey]), the [L.job] (Disconnected)\n" if(L.ckey && L.client) @@ -452,10 +447,8 @@ continue //Ghosted while alive - - for(var/mob/M in GLOB.mob_list) - if(M.client && M.client.holder) - to_chat(M, msg) + for (var/C in GLOB.admins) + to_chat(C, msg) /datum/game_mode/proc/printplayer(datum/mind/ply, fleecheck) var/text = "
[ply.key] was [ply.name] the [ply.assigned_role] and" @@ -535,4 +528,4 @@ //By default nuke just ends the round /datum/game_mode/proc/OnNukeExplosion(off_station) if(off_station < 2) - station_was_nuked = TRUE //Will end the round on next check. \ No newline at end of file + station_was_nuked = TRUE //Will end the round on next check. diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 2a4d7bc469ce..5e8359d7d4a3 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -375,7 +375,8 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( /obj/machinery/doomsday_device/proc/detonate() sound_to_playing_players('sound/machines/alarm.ogg') sleep(100) - for(var/mob/living/L in GLOB.mob_list) + for(var/i in GLOB.mob_living_list) + var/mob/living/L = i var/turf/T = get_turf(L) if(!T || !(T.z in GLOB.station_z_levels)) continue @@ -827,4 +828,4 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( AI.eyeobj.relay_speech = TRUE #undef DEFAULT_DOOMSDAY_TIMER -#undef DOOMSDAY_ANNOUNCE_INTERVAL \ No newline at end of file +#undef DOOMSDAY_ANNOUNCE_INTERVAL diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index c125f7648d52..e4e4205db8cf 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -654,7 +654,8 @@ /mob/living/simple_animal/hostile/swarmer/proc/swarmer_chat(msg) var/rendered = "Swarm communication - [src] [say_quote(msg, get_spans())]" - for(var/mob/M in GLOB.mob_list) + for(var/i in GLOB.mob_list) + var/mob/M = i if(isswarmer(M)) to_chat(M, rendered) if(isobserver(M)) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm index acef4ec8ac58..f8a1df3cb883 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm @@ -21,7 +21,8 @@ print_command_report(swarmer_report, announce=TRUE) /datum/round_event/spawn_swarmer/proc/find_swarmer() - for(var/mob/living/M in GLOB.mob_list) - if(istype(M, /mob/living/simple_animal/hostile/swarmer) && M.client) //If there is a swarmer with an active client, we've found our swarmer + for(var/i in GLOB.mob_living_list) + var/mob/living/L = i + if(istype(L, /mob/living/simple_animal/hostile/swarmer) && L.client) //If there is a swarmer with an active client, we've found our swarmer return 1 return 0 diff --git a/code/game/gamemodes/miniantags/monkey/monkey.dm b/code/game/gamemodes/miniantags/monkey/monkey.dm index e53313bbd379..379031dce9c1 100644 --- a/code/game/gamemodes/miniantags/monkey/monkey.dm +++ b/code/game/gamemodes/miniantags/monkey/monkey.dm @@ -76,7 +76,7 @@ return 0 var/datum/disease/D = new /datum/disease/transformation/jungle_fever() //ugly but unfortunately needed - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) if(H.mind && H.stat != DEAD) if(H.HasDisease(D)) return 0 @@ -87,7 +87,7 @@ if(SSshuttle.emergency.mode != SHUTTLE_ENDGAME) return 0 var/datum/disease/D = new /datum/disease/transformation/jungle_fever() - for(var/mob/living/carbon/monkey/M in GLOB.living_mob_list) + for(var/mob/living/carbon/monkey/M in GLOB.alive_mob_list) if (M.HasDisease(D)) if(M.onCentCom() || M.onSyndieBase()) escaped_monkeys++ diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index c2ce2a2d78e3..4fa9532b42a9 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -194,7 +194,7 @@ if(headrevs.len) var/num_revs = 0 var/num_survivors = 0 - for(var/mob/living/carbon/survivor in GLOB.living_mob_list) + for(var/mob/living/carbon/survivor in GLOB.alive_mob_list) if(survivor.ckey) num_survivors++ if(survivor.mind) diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index ced6ebbd35cb..3007ec51ba61 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -288,7 +288,7 @@ possible = list() if(!link) return - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) if(md5(H.dna.uni_identity) in link.fingerprints) possible |= H diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 93b290460699..23bfc72f8798 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -97,11 +97,12 @@ GLOB.cameranet.addCamera(src) emped = 0 //Resets the consecutive EMP count addtimer(CALLBACK(src, .proc/cancelCameraAlarm), 100) - for(var/mob/O in GLOB.mob_list) - if (O.client && O.client.eye == src) - O.unset_machine() - O.reset_perspective(null) - to_chat(O, "The screen bursts into static.") + for(var/i in GLOB.player_list) + var/mob/M = i + if (M.client.eye == src) + M.unset_machine() + M.reset_perspective(null) + to_chat(M, "The screen bursts into static.") ..() /obj/machinery/camera/tesla_act(var/power)//EMP proof upgrade also makes it tesla immune diff --git a/code/game/machinery/camera/motion.dm b/code/game/machinery/camera/motion.dm index e3104c71e67b..d9a93a657892 100644 --- a/code/game/machinery/camera/motion.dm +++ b/code/game/machinery/camera/motion.dm @@ -50,7 +50,8 @@ /obj/machinery/camera/proc/cancelAlarm() if (detectTime == -1) - for (var/mob/living/silicon/aiPlayer in GLOB.player_list) + for (var/i in GLOB.silicon_mobs) + var/mob/living/silicon/aiPlayer = i if (status) aiPlayer.cancelAlarm("Motion", get_area(src), src) detectTime = 0 @@ -69,4 +70,4 @@ // Motion cameras outside of an "ai monitored" area will use this to detect stuff. if (!area_motion) if(isliving(AM)) - newTarget(AM) \ No newline at end of file + newTarget(AM) diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 68f09890b6e7..6a5d8eb9bc43 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -48,26 +48,22 @@ if(usr.stat == DEAD) return list() - for(var/mob/living/M in GLOB.mob_list) - if(!M.can_track(usr)) + for(var/i in GLOB.mob_living_list) + var/mob/living/L = i + if(!L.can_track(usr)) continue - // Human check - var/human = 0 - if(ishuman(M)) - human = 1 - - var/name = M.name + var/name = L.name while(name in track.names) track.namecounts[name]++ name = text("[] ([])", name, track.namecounts[name]) track.names.Add(name) track.namecounts[name] = 1 - if(human) - track.humans[name] = M + if(ishuman(L)) + track.humans[name] = L else - track.others[name] = M + track.others[name] = L var/list/targets = sortList(track.humans) + sortList(track.others) diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index ea808171ccbe..c308d4335b3c 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -150,7 +150,7 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) var/pos_y var/life_status - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in GLOB.carbon_list) // Check if their z-level is correct and if they are wearing a uniform. // Accept H.z==0 as well in case the mob is inside an object. if ((H.z == 0 || H.z == z) && istype(H.w_uniform, /obj/item/clothing/under)) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index e413d204a23e..9e51d9125b09 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -173,7 +173,7 @@ dat += "Back" dat += "
Medical Robots:" var/bdat = null - for(var/mob/living/simple_animal/bot/medbot/M in GLOB.living_mob_list) + for(var/mob/living/simple_animal/bot/medbot/M in GLOB.alive_mob_list) if(M.z != src.z) continue //only find medibots on the same z-level as the computer var/turf/bl = get_turf(M) diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index ada4610e4b27..51188989f1a3 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -37,7 +37,7 @@ user.set_machine(src) var/dat var/robots = 0 - for(var/mob/living/silicon/robot/R in GLOB.mob_list) + for(var/mob/living/silicon/robot/R in GLOB.silicon_mobs) if(!can_control(user, R)) continue robots++ @@ -75,7 +75,7 @@ dat += "
" var/drones = 0 - for(var/mob/living/simple_animal/drone/D in GLOB.mob_list) + for(var/mob/living/simple_animal/drone/D in GLOB.drones_list) if(D.hacked) continue drones++ diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 13f12c6d3ff9..7e73ef0c64d6 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -699,7 +699,7 @@ What a mess.*/ if("released") active2.fields["criminal"] = "Discharged" investigate_log("[active1.fields["name"]] has been set from [old_field] to [active2.fields["criminal"]] by [usr.name] ([usr.key]).", INVESTIGATE_RECORDS) - for(var/mob/living/carbon/human/H in GLOB.mob_list) //thanks for forcing me to do this, whoever wrote this shitty records system + for(var/mob/living/carbon/human/H in GLOB.carbon_list) H.sec_hud_set_security_status() if("Delete Record (Security) Execute") investigate_log("[usr.name] ([usr.key]) has deleted the security records for [active1.fields["name"]].", INVESTIGATE_RECORDS) diff --git a/code/game/objects/effects/manifest.dm b/code/game/objects/effects/manifest.dm index 03a7bd76b4c8..2082f2b49524 100644 --- a/code/game/objects/effects/manifest.dm +++ b/code/game/objects/effects/manifest.dm @@ -8,7 +8,7 @@ /obj/effect/manifest/proc/manifest() var/dat = "Crew Manifest:
" - for(var/mob/living/carbon/human/M in GLOB.mob_list) + for(var/mob/living/carbon/human/M in GLOB.carbon_list) dat += text(" [] - []
", M.name, M.get_assignment()) var/obj/item/paper/P = new /obj/item/paper( src.loc ) P.info = dat diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index ab10d7a5ba4c..a83fb8cf8949 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -505,7 +505,7 @@ Code: menu += "

Located Cleanbots:

" ldat = null - for (var/mob/living/simple_animal/bot/cleanbot/B in GLOB.living_mob_list) + for (var/mob/living/simple_animal/bot/cleanbot/B in GLOB.alive_mob_list) var/turf/bl = get_turf(B) if(bl) @@ -715,7 +715,7 @@ Code: var/turf/current_turf = get_turf(src) var/zlevel = current_turf.z var/botcount = 0 - for(Bot in GLOB.living_mob_list) //Git da botz + for(Bot in GLOB.alive_mob_list) //Git da botz if(!Bot.on || Bot.z != zlevel || Bot.remote_disabled || !(bot_access_flags & Bot.bot_type)) //Only non-emagged bots on the same Z-level are detected! continue //Also, the PDA must have access to the bot type. menu += "[Bot.name] ([Bot.get_mode()])
" diff --git a/code/game/objects/items/pinpointer.dm b/code/game/objects/items/pinpointer.dm index 95193eee9ea0..a6d0d285bf05 100644 --- a/code/game/objects/items/pinpointer.dm +++ b/code/game/objects/items/pinpointer.dm @@ -104,7 +104,7 @@ var/list/name_counts = list() var/list/names = list() - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in GLOB.carbon_list) if(!trackable(H)) continue @@ -149,4 +149,3 @@ return PROCESS_KILL scan_for_target() update_icon() - diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 3edd7e810ccc..fb646059bf42 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -700,7 +700,8 @@ /datum/admins/proc/output_ai_laws() var/ai_number = 0 - for(var/mob/living/silicon/S in GLOB.mob_list) + for(var/i in GLOB.silicon_mobs) + var/mob/living/silicon/S = i ai_number++ if(isAI(S)) to_chat(usr, "AI [key_name(S, usr)]'s laws:") diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index 0a347b110131..5678deb58696 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -255,7 +255,7 @@ return var/dat = "Showing DNA from blood.
" dat += "" - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in GLOB.carbon_list) if(H.ckey) dat += "" dat += "
NameDNABlood Type
[H][H.dna.unique_enzymes][H.dna.blood_type]
" @@ -265,7 +265,7 @@ return var/dat = "Showing Fingerprints.
" dat += "" - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in GLOB.carbon_list) if(H.ckey) dat += "" dat += "
NameFingerprints
[H][md5(H.dna.uni_identity)]
" @@ -275,7 +275,7 @@ if(!check_rights(R_FUN)) return SSblackbox.add_details("admin_secrets_fun_used","Monkeyize All Humans") - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in GLOB.carbon_list) spawn(0) H.monkeyize() ok = 1 @@ -289,7 +289,7 @@ log_admin("[key_name(usr)] turned all humans into [result]", 1) message_admins("\blue [key_name_admin(usr)] turned all humans into [result]") var/newtype = GLOB.species_list[result] - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in GLOB.carbon_list) H.set_species(newtype) if("tripleAI") @@ -382,7 +382,7 @@ return SSblackbox.add_details("admin_secrets_fun_used","Chinese Cartoons") message_admins("[key_name_admin(usr)] made everything kawaii.") - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in GLOB.carbon_list) SEND_SOUND(H, sound('sound/ai/animes.ogg')) if(H.dna.species.id == "human") @@ -500,7 +500,7 @@ if(!check_rights(R_FUN)) return SSblackbox.add_details("admin_secrets_fun_used","Dwarf Beards") - for(var/mob/living/carbon/human/B in GLOB.mob_list) + for(var/mob/living/carbon/human/B in GLOB.carbon_list) B.facial_hair_style = "Dward Beard" B.update_hair() message_admins("[key_name_admin(usr)] activated dorf mode") diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 16d9ffbce70e..5973cbb72a15 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -759,7 +759,7 @@ GLOBAL_PROTECT(LastAdminCalledProc) if("Mobs") to_chat(usr, jointext(GLOB.mob_list,",")) if("Living Mobs") - to_chat(usr, jointext(GLOB.living_mob_list,",")) + to_chat(usr, jointext(GLOB.alive_mob_list,",")) if("Dead Mobs") to_chat(usr, jointext(GLOB.dead_mob_list,",")) if("Clients") diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index d57e4d58e596..554dd7db53b0 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1006,7 +1006,7 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits if(confirm != "Yes") return - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in GLOB.carbon_list) new /obj/item/organ/zombie_infection(H) message_admins("[key_name_admin(usr)] added a latent zombie infection to all humans.") @@ -1043,7 +1043,7 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits if(confirm != "Yes") return - var/list/mobs = shuffle(GLOB.living_mob_list.Copy()) // might change while iterating + var/list/mobs = shuffle(GLOB.alive_mob_list.Copy()) // might change while iterating var/who_did_it = key_name_admin(usr) message_admins("[key_name_admin(usr)] started polymorphed all living mobs.") diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index dc5cc63ec3ee..3031936d4398 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -32,7 +32,7 @@ ////////// wildwest papers - + /obj/item/paper/fluff/awaymissions/wildwest/grinder info = "meat grinder requires sacri" @@ -124,7 +124,7 @@ if("Peace") to_chat(user, "Whatever alien sentience that the Wish Granter possesses is satisfied with your wish. There is a distant wailing as the last of the Faithless begin to die, then silence.") to_chat(user, "You feel as if you just narrowly avoided a terrible fate...") - for(var/mob/living/simple_animal/hostile/faithless/F in GLOB.mob_list) + for(var/mob/living/simple_animal/hostile/faithless/F in GLOB.mob_living_list) F.death() diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm index ba132245a77d..9ce4bf6ac3c0 100644 --- a/code/modules/events/disease_outbreak.dm +++ b/code/modules/events/disease_outbreak.dm @@ -29,7 +29,7 @@ if(!virus_type && !advanced_virus) virus_type = pick(/datum/disease/dnaspread, /datum/disease/advance/flu, /datum/disease/advance/cold, /datum/disease/brainrot, /datum/disease/magnitis) - for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list)) + for(var/mob/living/carbon/human/H in shuffle(GLOB.alive_mob_list)) var/turf/T = get_turf(H) if(!T) continue diff --git a/code/modules/events/holiday/halloween.dm b/code/modules/events/holiday/halloween.dm index 48328028b746..f6144b412d97 100644 --- a/code/modules/events/holiday/halloween.dm +++ b/code/modules/events/holiday/halloween.dm @@ -8,14 +8,14 @@ /datum/round_event/spooky/start() ..() - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in GLOB.carbon_list) var/obj/item/storage/backpack/b = locate() in H.contents if(b) new /obj/item/storage/spooky(b) - for(var/mob/living/simple_animal/pet/dog/corgi/Ian/Ian in GLOB.mob_list) + for(var/mob/living/simple_animal/pet/dog/corgi/Ian/Ian in GLOB.mob_living_list) Ian.place_on_head(new /obj/item/bedsheet(Ian)) - for(var/mob/living/simple_animal/parrot/Poly/Poly in GLOB.mob_list) + for(var/mob/living/simple_animal/parrot/Poly/Poly in GLOB.mob_living_list) new /mob/living/simple_animal/parrot/Poly/ghost(Poly.loc) qdel(Poly) diff --git a/code/modules/events/holiday/vday.dm b/code/modules/events/holiday/vday.dm index 52ba8261014e..41ff90407d85 100644 --- a/code/modules/events/holiday/vday.dm +++ b/code/modules/events/holiday/vday.dm @@ -14,7 +14,7 @@ /datum/round_event/valentines/start() ..() - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) H.put_in_hands(new /obj/item/valentine) var/obj/item/storage/backpack/b = locate() in H.contents new /obj/item/reagent_containers/food/snacks/candyheart(b) diff --git a/code/modules/events/holiday/xmas.dm b/code/modules/events/holiday/xmas.dm index 412616f800f1..2f5618714d56 100644 --- a/code/modules/events/holiday/xmas.dm +++ b/code/modules/events/holiday/xmas.dm @@ -30,7 +30,7 @@ for(var/turf/open/floor/T in orange(1,xmas)) for(var/i=1,i<=rand(1,5),i++) new /obj/item/a_gift(T) - for(var/mob/living/simple_animal/pet/dog/corgi/Ian/Ian in GLOB.mob_list) + for(var/mob/living/simple_animal/pet/dog/corgi/Ian/Ian in GLOB.mob_living_list) Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat(Ian)) for(var/obj/machinery/computer/security/telescreen/entertainment/Monitor in GLOB.machines) Monitor.icon_state = "entertainment_xmas" diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index 2bd64f47609a..3b55a794f1f1 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -32,7 +32,7 @@ /datum/round_event/ion_storm/start() //AI laws - for(var/mob/living/silicon/ai/M in GLOB.living_mob_list) + for(var/mob/living/silicon/ai/M in GLOB.alive_mob_list) M.laws_sanity_check() if(M.stat != DEAD && M.see_in_dark != 0) if(prob(replaceLawsetChance)) @@ -55,7 +55,7 @@ M.post_lawchange() if(botEmagChance) - for(var/mob/living/simple_animal/bot/bot in GLOB.living_mob_list) + for(var/mob/living/simple_animal/bot/bot in GLOB.alive_mob_list) if(prob(botEmagChance)) bot.emag_act() diff --git a/code/modules/events/mass_hallucination.dm b/code/modules/events/mass_hallucination.dm index 9d345507a1a3..5bad888f1799 100644 --- a/code/modules/events/mass_hallucination.dm +++ b/code/modules/events/mass_hallucination.dm @@ -9,5 +9,5 @@ fakeable = FALSE /datum/round_event/mass_hallucination/start() - for(var/mob/living/carbon/C in GLOB.living_mob_list) + for(var/mob/living/carbon/C in GLOB.alive_mob_list) C.hallucination += rand(20, 50) \ No newline at end of file diff --git a/code/modules/events/sentience.dm b/code/modules/events/sentience.dm index c2ed5e8112ac..f5fa946b3ec9 100644 --- a/code/modules/events/sentience.dm +++ b/code/modules/events/sentience.dm @@ -28,7 +28,7 @@ // find our chosen mob to breathe life into // Mobs have to be simple animals, mindless and on station var/list/potential = list() - for(var/mob/living/simple_animal/L in GLOB.living_mob_list) + for(var/mob/living/simple_animal/L in GLOB.alive_mob_list) var/turf/T = get_turf(L) if(!(T.z in GLOB.station_z_levels)) continue diff --git a/code/modules/events/spontaneous_appendicitis.dm b/code/modules/events/spontaneous_appendicitis.dm index eb189decda91..a9ae27993d51 100644 --- a/code/modules/events/spontaneous_appendicitis.dm +++ b/code/modules/events/spontaneous_appendicitis.dm @@ -10,7 +10,7 @@ fakeable = FALSE /datum/round_event/spontaneous_appendicitis/start() - for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list)) + for(var/mob/living/carbon/human/H in shuffle(GLOB.alive_mob_list)) if(!H.client) continue if(H.stat == DEAD) diff --git a/code/modules/events/wizard/aid.dm b/code/modules/events/wizard/aid.dm index 37ab62161d93..e00e7da4be2e 100644 --- a/code/modules/events/wizard/aid.dm +++ b/code/modules/events/wizard/aid.dm @@ -9,7 +9,8 @@ /datum/round_event/wizard/robelesscasting/start() - for(var/mob/living/L in GLOB.mob_list) //Hey if a corgi has magic missle he should get the same benifit as anyone + for(var/i in GLOB.mob_living_list) //Hey if a corgi has magic missle he should get the same benifit as anyone + var/mob/living/L = i if(L.mind && L.mind.spell_list.len != 0) var/spell_improved = FALSE for(var/obj/effect/proc_holder/spell/S in L.mind.spell_list) @@ -29,7 +30,8 @@ earliest_start = 0 /datum/round_event/wizard/improvedcasting/start() - for(var/mob/living/L in GLOB.mob_list) + for(var/i in GLOB.mob_living_list) + var/mob/living/L = i if(L.mind && L.mind.spell_list.len != 0) for(var/obj/effect/proc_holder/spell/S in L.mind.spell_list) S.name = initial(S.name) diff --git a/code/modules/events/wizard/curseditems.dm b/code/modules/events/wizard/curseditems.dm index 30a4377839e0..121a0e5083dd 100644 --- a/code/modules/events/wizard/curseditems.dm +++ b/code/modules/events/wizard/curseditems.dm @@ -37,7 +37,7 @@ ruins_spaceworthiness = 1 ruins_wizard_loadout = 1 - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) if(ruins_spaceworthiness && !(H.z in GLOB.station_z_levels) || isspaceturf(H.loc) || isplasmaman(H)) continue //#savetheminers if(ruins_wizard_loadout && iswizard(H)) @@ -54,7 +54,7 @@ I.flags_1 |= NODROP_1 I.name = "cursed " + I.name - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) var/datum/effect_system/smoke_spread/smoke = new smoke.set_up(0, H.loc) smoke.start() diff --git a/code/modules/events/wizard/departmentrevolt.dm b/code/modules/events/wizard/departmentrevolt.dm index a22913038fbe..618c746a65b5 100644 --- a/code/modules/events/wizard/departmentrevolt.dm +++ b/code/modules/events/wizard/departmentrevolt.dm @@ -35,7 +35,7 @@ nation += pick("stan", "topia", "land", "nia", "ca", "tova", "dor", "ador", "tia", "sia", "ano", "tica", "tide", "cis", "marea", "co", "taoide", "slavia", "stotzka") - for(var/mob/living/carbon/human/H in GLOB.mob_list) + for(var/mob/living/carbon/human/H in GLOB.carbon_list) if(H.mind) var/datum/mind/M = H.mind if(M.assigned_role && !(M in SSticker.mode.traitors)) diff --git a/code/modules/events/wizard/greentext.dm b/code/modules/events/wizard/greentext.dm index cde451405ca0..6ee000249b4e 100644 --- a/code/modules/events/wizard/greentext.dm +++ b/code/modules/events/wizard/greentext.dm @@ -83,7 +83,8 @@ . = ..() GLOB.poi_list.Remove(src) - for(var/mob/M in GLOB.mob_list) + for(var/i in GLOB.player_list) + var/mob/M = i var/message = "A dark temptation has passed from this world" if(M in color_altered_mobs) message += " and you're finally able to forgive yourself" diff --git a/code/modules/events/wizard/invincible.dm b/code/modules/events/wizard/invincible.dm index adb0a107b246..ff5d57454110 100644 --- a/code/modules/events/wizard/invincible.dm +++ b/code/modules/events/wizard/invincible.dm @@ -7,6 +7,6 @@ /datum/round_event/wizard/invincible/start() - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) H.reagents.add_reagent("adminordrazine", 40) //100 ticks of absolute invinciblity (barring gibs) to_chat(H, "You feel invincible, nothing can hurt you!") \ No newline at end of file diff --git a/code/modules/events/wizard/petsplosion.dm b/code/modules/events/wizard/petsplosion.dm index 5654cbfe04e3..3459c8031842 100644 --- a/code/modules/events/wizard/petsplosion.dm +++ b/code/modules/events/wizard/petsplosion.dm @@ -7,7 +7,7 @@ var/mobs_to_dupe = 0 /datum/round_event_control/wizard/petsplosion/preRunEvent() - for(var/mob/living/simple_animal/F in GLOB.living_mob_list) + for(var/mob/living/simple_animal/F in GLOB.alive_mob_list) if(!ishostile(F) && (F.z in GLOB.station_z_levels)) mobs_to_dupe++ if(mobs_to_dupe > 100 || !mobs_to_dupe) @@ -23,7 +23,7 @@ /datum/round_event/wizard/petsplosion/tick() if(activeFor >= 30 * countdown) // 0 seconds : 2 animals | 30 seconds : 4 animals | 1 minute : 8 animals countdown += 1 - for(var/mob/living/simple_animal/F in GLOB.living_mob_list) //If you cull the heard before the next replication, things will be easier for you + for(var/mob/living/simple_animal/F in GLOB.alive_mob_list) //If you cull the heard before the next replication, things will be easier for you if(!ishostile(F) && (F.z in GLOB.station_z_levels)) new F.type(F.loc) mobs_duped++ diff --git a/code/modules/events/wizard/race.dm b/code/modules/events/wizard/race.dm index 298d92dd3c98..e054be9b08f2 100644 --- a/code/modules/events/wizard/race.dm +++ b/code/modules/events/wizard/race.dm @@ -20,7 +20,7 @@ if(prob(50)) all_the_same = 1 - for(var/mob/living/carbon/human/H in GLOB.mob_list) //yes, even the dead + for(var/mob/living/carbon/human/H in GLOB.carbon_list) //yes, even the dead H.set_species(new_species) H.real_name = new_species.random_name(H.gender,1) H.dna.unique_enzymes = H.dna.generate_unique_enzymes() diff --git a/code/modules/events/wizard/shuffle.dm b/code/modules/events/wizard/shuffle.dm index 2f525d209822..d622f10c9732 100644 --- a/code/modules/events/wizard/shuffle.dm +++ b/code/modules/events/wizard/shuffle.dm @@ -12,7 +12,7 @@ var/list/moblocs = list() var/list/mobs = list() - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) if(!(H.z in GLOB.station_z_levels)) continue //lets not try to strand people in space or stuck in the wizards den moblocs += H.loc @@ -30,7 +30,7 @@ do_teleport(H, moblocs[moblocs.len]) moblocs.len -= 1 - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) var/datum/effect_system/smoke_spread/smoke = new smoke.set_up(0, H.loc) smoke.start() @@ -48,7 +48,7 @@ var/list/mobnames = list() var/list/mobs = list() - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) mobnames += H.real_name mobs += H @@ -64,7 +64,7 @@ H.real_name = mobnames[mobnames.len] mobnames.len -= 1 - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) var/datum/effect_system/smoke_spread/smoke = new smoke.set_up(0, H.loc) smoke.start() @@ -81,7 +81,7 @@ /datum/round_event/wizard/shuffleminds/start() var/list/mobs = list() - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) if(H.stat || !H.mind || iswizard(H)) continue //the wizard(s) are spared on this one mobs += H @@ -98,7 +98,7 @@ swapper.cast(list(H), mobs[mobs.len], 1) mobs -= mobs[mobs.len] - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) var/datum/effect_system/smoke_spread/smoke = new smoke.set_up(0, H.loc) smoke.start() diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index eed00add655d..749b98c09ae7 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -460,7 +460,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( var/image/A = null var/kind = force_kind ? force_kind : pick("monkey","corgi","carp","skeleton","demon","zombie") feedback_details += "Type: [kind]" - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) if(H == target) continue if(skip_nearby && (H in view(target))) @@ -538,7 +538,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( var/mob/living/carbon/human/clone = null var/clone_weapon = null - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) if(H.stat || H.lying) continue clone = H @@ -769,7 +769,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( target.client.images.Remove(speech_overlay) else // Radio talk var/list/humans = list() - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) humans += H person = pick(humans) var/message = target.compose_message(person,understood_language,pick(radio_messages),"1459",person.get_spans(),face_name = TRUE) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 18ba329148b3..e6fb8d9ce96f 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -565,7 +565,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set desc= "Take over the body of a mindless creature!" var/list/possessible = list() - for(var/mob/living/L in GLOB.living_mob_list) + for(var/mob/living/L in GLOB.alive_mob_list) if(!(L in GLOB.player_list) && !L.mind) possessible += L diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index 83dd63cc7487..4cd04a7617af 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -63,7 +63,7 @@ if(!newbrain.damaged_brain) // the brain organ hasn't been beaten to death. brainmob.stat = CONSCIOUS //we manually revive the brain mob GLOB.dead_mob_list -= brainmob - GLOB.living_mob_list += brainmob + GLOB.alive_mob_list += brainmob brainmob.reset_perspective() brain = newbrain @@ -95,7 +95,7 @@ brainmob.stat = DEAD brainmob.emp_damage = 0 brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision - GLOB.living_mob_list -= brainmob //Get outta here + GLOB.alive_mob_list -= brainmob //Get outta here GLOB.dead_mob_list += brainmob brain.brainmob = brainmob //Set the brain to use the brainmob brainmob = null //Set mmi brainmob var to null diff --git a/code/modules/mob/living/brain/posibrain.dm b/code/modules/mob/living/brain/posibrain.dm index 90f42a9ddada..3bf052599673 100644 --- a/code/modules/mob/living/brain/posibrain.dm +++ b/code/modules/mob/living/brain/posibrain.dm @@ -126,7 +126,7 @@ GLOBAL_VAR(posibrain_notify_cooldown) brainmob.mind.assigned_role = new_role brainmob.stat = CONSCIOUS GLOB.dead_mob_list -= brainmob - GLOB.living_mob_list += brainmob + GLOB.alive_mob_list += brainmob visible_message(new_mob_message) check_success() diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 6d47f7fde2a0..89edbf759c47 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -109,11 +109,12 @@ Des: Gives the client of the alien an image on each infected mob. ----------------------------------------*/ /mob/living/carbon/alien/proc/AddInfectionImages() if (client) - for (var/mob/living/C in GLOB.mob_list) - if(C.status_flags & XENO_HOST) - var/obj/item/organ/body_egg/alien_embryo/A = C.getorgan(/obj/item/organ/body_egg/alien_embryo) + for (var/i in GLOB.mob_living_list) + var/mob/living/L = i + if(L.status_flags & XENO_HOST) + var/obj/item/organ/body_egg/alien_embryo/A = L.getorgan(/obj/item/organ/body_egg/alien_embryo) if(A) - var/I = image('icons/mob/alien.dmi', loc = C, icon_state = "infected[A.stage]") + var/I = image('icons/mob/alien.dmi', loc = L, icon_state = "infected[A.stage]") client.images += I return diff --git a/code/modules/mob/living/carbon/alien/humanoid/death.dm b/code/modules/mob/living/carbon/alien/humanoid/death.dm index 1ccfcad572d5..c6c675ead940 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/death.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/death.dm @@ -13,7 +13,7 @@ if(stat == DEAD) return - for(var/mob/living/carbon/C in GLOB.living_mob_list) + for(var/mob/living/carbon/C in GLOB.alive_mob_list) if(C == src) //Make sure not to proc it on ourselves. continue var/obj/item/organ/alien/hivenode/node = C.getorgan(/obj/item/organ/alien/hivenode) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index d9ce6b904de8..fdca497bc308 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -111,7 +111,7 @@ //For alien evolution/promotion/queen finder procs. Checks for an active alien of that type /proc/get_alien_type(var/alienpath) - for(var/mob/living/carbon/alien/humanoid/A in GLOB.living_mob_list) + for(var/mob/living/carbon/alien/humanoid/A in GLOB.alive_mob_list) if(!istype(A, alienpath)) continue if(!A.key || A.stat == DEAD) //Only living aliens with a ckey are valid. diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 51ab4bdde8f9..4f79ed7d2568 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -46,7 +46,7 @@ /mob/living/carbon/alien/humanoid/royal/queen/Initialize() //there should only be one queen - for(var/mob/living/carbon/alien/humanoid/royal/queen/Q in GLOB.living_mob_list) + for(var/mob/living/carbon/alien/humanoid/royal/queen/Q in GLOB.carbon_list) if(Q == src) continue if(Q.stat == DEAD) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index ac3d8c05174a..d5005a76fb11 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -5,6 +5,7 @@ . = ..() create_reagents(1000) update_body_parts() //to update the carbon's new bodyparts appearance + GLOB.carbon_list += src /mob/living/carbon/Destroy() //This must be done first, so the mob ghosts correctly before DNA etc is nulled @@ -16,6 +17,7 @@ QDEL_LIST(implants) remove_from_all_data_huds() QDEL_NULL(dna) + GLOB.carbon_list -= src /mob/living/carbon/relaymove(mob/user, direction) if(user in src.stomach_contents) diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index 5a3d10ac12cc..5f50b7adee58 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -57,7 +57,7 @@ deadchat_broadcast(rendered, follow_target = src, turf_target = T, message_type=DEADCHAT_DEATHRATTLE) if(mind) mind.store_memory("Time of death: [tod]", 0) - GLOB.living_mob_list -= src + GLOB.alive_mob_list -= src if(!gibbed) GLOB.dead_mob_list += src set_drugginess(0) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index f40f63bd4480..85d2f67e7186 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -16,6 +16,7 @@ var/datum/atom_hud/data/human/medical/advanced/medhud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] medhud.add_to_hud(src) faction += "[REF(src)]" + GLOB.mob_living_list += src /mob/living/prepare_huds() @@ -47,6 +48,7 @@ qdel(I) staticOverlays.len = 0 remove_from_all_data_huds() + GLOB.mob_living_list -= src return ..() @@ -368,7 +370,7 @@ fully_heal(admin_revive) if(stat == DEAD && can_be_revived()) //in some cases you can't revive (e.g. no brain) GLOB.dead_mob_list -= src - GLOB.living_mob_list += src + GLOB.alive_mob_list += src suiciding = 0 stat = UNCONSCIOUS //the mob starts unconscious, blind_eyes(1) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 4068d3c2e9cb..36bd1893e2ec 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -404,14 +404,14 @@ if(call_bot_cooldown > world.time) to_chat(src, "Error: Your last call bot command is still processing, please wait for the bot to finish calculating a route.") return - Bot = locate(href_list["callbot"]) in GLOB.living_mob_list + Bot = locate(href_list["callbot"]) in GLOB.alive_mob_list if(!Bot || Bot.remote_disabled || src.control_disabled) return //True if there is no bot found, the bot is manually emagged, or the AI is carded with wireless off. waypoint_mode = 1 to_chat(src, "Set your waypoint by clicking on a valid location free of obstructions.") return if(href_list["interface"]) //Remotely connect to a bot! - Bot = locate(href_list["interface"]) in GLOB.living_mob_list + Bot = locate(href_list["interface"]) in GLOB.alive_mob_list if(!Bot || Bot.remote_disabled || src.control_disabled) return Bot.attack_ai(src) @@ -468,7 +468,7 @@ d += "
Query network status
" d += "" - for (Bot in GLOB.living_mob_list) + for (Bot in GLOB.alive_mob_list) if(Bot.z == ai_Zlevel && !Bot.remote_disabled) //Only non-emagged bots on the same Z-level are detected! bot_area = get_area(Bot) var/bot_mode = Bot.get_mode() diff --git a/code/modules/mob/living/silicon/pai/death.dm b/code/modules/mob/living/silicon/pai/death.dm index 0526db2a7858..a75089ed680d 100644 --- a/code/modules/mob/living/silicon/pai/death.dm +++ b/code/modules/mob/living/silicon/pai/death.dm @@ -9,6 +9,6 @@ clear_fullscreens() //New pAI's get a brand new mind to prevent meta stuff from their previous life. This new mind causes problems down the line if it's not deleted here. - GLOB.living_mob_list -= src + GLOB.alive_mob_list -= src ghostize() qdel(src) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index df872e25e7a5..d3de956d0e8d 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -172,7 +172,7 @@ if(mmi.brainmob.stat == DEAD) mmi.brainmob.stat = CONSCIOUS GLOB.dead_mob_list -= mmi.brainmob - GLOB.living_mob_list += mmi.brainmob + GLOB.alive_mob_list += mmi.brainmob mind.transfer_to(mmi.brainmob) mmi.update_icon() else diff --git a/code/modules/mob/living/simple_animal/friendly/drone/say.dm b/code/modules/mob/living/simple_animal/friendly/drone/say.dm index bbf3fdc63fa2..fb0c0c06145d 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/say.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/say.dm @@ -18,17 +18,19 @@ //Base proc for anything to call /proc/_alert_drones(msg, dead_can_hear = 0, atom/source, mob/living/faction_checked_mob, exact_faction_match) - for(var/W in GLOB.mob_list) - var/mob/living/simple_animal/drone/M = W - if(istype(M) && M.stat != DEAD) - if(faction_checked_mob) - if(M.faction_check_mob(faction_checked_mob, exact_faction_match)) - to_chat(M, msg) - else - to_chat(M, msg) - if(dead_can_hear && source && (M in GLOB.dead_mob_list)) + if (dead_can_hear && source) + for (var/mob/M in GLOB.dead_mob_list) var/link = FOLLOW_LINK(M, source) to_chat(M, "[link] [msg]") + for(var/i in GLOB.drones_list) + var/mob/living/simple_animal/drone/D = i + if(istype(D) && D.stat != DEAD) + if(faction_checked_mob) + if(D.faction_check_mob(faction_checked_mob, exact_faction_match)) + to_chat(D, msg) + else + to_chat(D, msg) + //Wrapper for drones to handle factions diff --git a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm index 325b9711710d..8a7953a140c9 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm @@ -150,7 +150,8 @@ staticOverlays.len = 0 if(seeStatic) - for(var/mob/living/L in GLOB.mob_list) + for(var/i in GLOB.mob_living_list) + var/mob/living/L = i if(isdrone(L)) continue var/image/chosen diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index 6aa6ba781a46..a977338008cd 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -106,7 +106,7 @@ Difficulty: Hard /mob/living/simple_animal/hostile/megafauna/bubblegum/Initialize() . = ..() - for(var/mob/living/simple_animal/hostile/megafauna/bubblegum/B in GLOB.mob_list) + for(var/mob/living/simple_animal/hostile/megafauna/bubblegum/B in GLOB.mob_living_list) if(B != src) return INITIALIZE_HINT_QDEL //There can be only one var/obj/effect/proc_holder/spell/bloodcrawl/bloodspell = new @@ -401,4 +401,4 @@ Difficulty: Hard return 1 return 0 -#undef MEDAL_PREFIX \ No newline at end of file +#undef MEDAL_PREFIX diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm index ee0c16a7682a..0380234396c1 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm @@ -129,7 +129,7 @@ Difficulty: Medium visible_message("[src] splits in twain!") else var/last_legion = TRUE - for(var/mob/living/simple_animal/hostile/megafauna/legion/other in GLOB.mob_list) + for(var/mob/living/simple_animal/hostile/megafauna/legion/other in GLOB.mob_living_list) if(other != src) last_legion = FALSE break diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/necropolis_tendril.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/necropolis_tendril.dm index d5d116d67813..b57943779656 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/necropolis_tendril.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/necropolis_tendril.dm @@ -50,7 +50,7 @@ #define MEDAL_PREFIX "Tendril" /mob/living/simple_animal/hostile/spawner/lavaland/death() var/last_tendril = TRUE - for(var/mob/living/simple_animal/hostile/spawner/lavaland/other in GLOB.mob_list) + for(var/mob/living/simple_animal/hostile/spawner/lavaland/other in GLOB.mob_living_list) if(other != src) last_tendril = FALSE break diff --git a/code/modules/mob/living/simple_animal/hostile/statue.dm b/code/modules/mob/living/simple_animal/hostile/statue.dm index 8fc327702bed..e5aa946b00b8 100644 --- a/code/modules/mob/living/simple_animal/hostile/statue.dm +++ b/code/modules/mob/living/simple_animal/hostile/statue.dm @@ -185,7 +185,7 @@ range = 10 /obj/effect/proc_holder/spell/aoe_turf/blindness/cast(list/targets,mob/user = usr) - for(var/mob/living/L in GLOB.living_mob_list) + for(var/mob/living/L in GLOB.alive_mob_list) var/turf/T = get_turf(L.loc) if(T && T in targets) L.blind_eyes(4) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ea414769ecc6..9f36ae0a6fe5 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -4,7 +4,7 @@ /mob/Destroy()//This makes sure that mobs with clients/keys are not just deleted from the game. GLOB.mob_list -= src GLOB.dead_mob_list -= src - GLOB.living_mob_list -= src + GLOB.alive_mob_list -= src GLOB.all_clockwork_mobs -= src GLOB.mob_directory -= tag for (var/alert in alerts) @@ -29,7 +29,7 @@ if(stat == DEAD) GLOB.dead_mob_list += src else - GLOB.living_mob_list += src + GLOB.alive_mob_list += src prepare_huds() for(var/v in GLOB.active_alternate_appearances) if(!v) @@ -918,9 +918,9 @@ if("stat") if((stat == DEAD) && (var_value < DEAD))//Bringing the dead back to life GLOB.dead_mob_list -= src - GLOB.living_mob_list += src + GLOB.alive_mob_list += src if((stat < DEAD) && (var_value == DEAD))//Kill he - GLOB.living_mob_list -= src + GLOB.alive_mob_list -= src GLOB.dead_mob_list += src . = ..() switch(var_name) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 30bdaa67169b..3dc56c936b87 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -274,7 +274,8 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /proc/findname(msg) if(!istext(msg)) msg = "[msg]" - for(var/mob/M in GLOB.mob_list) + for(var/i in GLOB.mob_list) + var/mob/M = i if(M.real_name == msg) return M return 0 diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index e19f152a75c6..65e6d4c0e4a0 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -369,7 +369,8 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne /obj/machinery/gravity_generator/main/proc/shake_everyone() var/turf/T = get_turf(src) var/sound/alert_sound = sound('sound/effects/alert.ogg') - for(var/mob/M in GLOB.mob_list) + for(var/i in GLOB.mob_list) + var/mob/M = i if(M.z != z) continue M.update_gravity(M.mob_has_gravity()) diff --git a/code/modules/power/singularity/narsie.dm b/code/modules/power/singularity/narsie.dm index 81dcd573f546..22712e970dee 100644 --- a/code/modules/power/singularity/narsie.dm +++ b/code/modules/power/singularity/narsie.dm @@ -140,7 +140,7 @@ acquire(enemy) return - for(var/mob/living/carbon/food in GLOB.living_mob_list) //we don't care about constructs or cult-Ians or whatever. cult-monkeys are fair game i guess + for(var/mob/living/carbon/food in GLOB.alive_mob_list) //we don't care about constructs or cult-Ians or whatever. cult-monkeys are fair game i guess var/turf/pos = get_turf(food) if(!pos || (pos.z != z)) continue diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 9c5dde865470..de67f837f415 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -229,7 +229,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard) /obj/machinery/power/supermatter_shard/proc/explode() var/turf/T = get_turf(src) - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in GLOB.player_list) if(M.z == z) SEND_SOUND(M, 'sound/magic/charge.ogg') to_chat(M, "You feel reality distort for a moment...") @@ -427,7 +427,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard) radio.talk_into(src, "Warning: Critical coolant mass reached.", engineering_channel, get_spans(), get_default_language()) if(damage > explosion_point) - for(var/mob in GLOB.living_mob_list) + for(var/mob in GLOB.alive_mob_list) var/mob/living/L = mob if(istype(L) && L.z == z) if(ishuman(mob)) @@ -466,7 +466,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard) investigate_log("Supermatter shard consumed by singularity.", INVESTIGATE_SINGULO) message_admins("Singularity has consumed a supermatter shard and can now become stage six.") visible_message("[src] is consumed by the singularity!") - for(var/mob/M in GLOB.mob_list) + for(var/mob/M in GLOB.player_list) if(M.z == z) SEND_SOUND(M, 'sound/effects/supermatter.ogg') //everyone goan know bout this to_chat(M, "A horrible screeching fills your ears, and a wave of dread washes over you...") diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index 4cf711bbeea0..1f2a3bb47215 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -86,8 +86,8 @@ /obj/machinery/r_n_d/experimentor/Initialize() . = ..() - trackedIan = locate(/mob/living/simple_animal/pet/dog/corgi/Ian) in GLOB.mob_list - trackedRuntime = locate(/mob/living/simple_animal/pet/cat/Runtime) in GLOB.mob_list + trackedIan = locate(/mob/living/simple_animal/pet/dog/corgi/Ian) in GLOB.mob_living_list + trackedRuntime = locate(/mob/living/simple_animal/pet/cat/Runtime) in GLOB.mob_living_list SetTypeReactions() /obj/machinery/r_n_d/experimentor/RefreshParts() diff --git a/code/modules/shuttle/arrivals.dm b/code/modules/shuttle/arrivals.dm index b42ee4e0e418..a862abf71394 100644 --- a/code/modules/shuttle/arrivals.dm +++ b/code/modules/shuttle/arrivals.dm @@ -117,7 +117,7 @@ return FALSE /obj/docking_port/mobile/arrivals/proc/PersonCheck() - for(var/M in (GLOB.living_mob_list & GLOB.player_list)) + for(var/M in (GLOB.alive_mob_list & GLOB.player_list)) var/mob/living/L = M if((get_area(M) in areas) && L.stat != DEAD) return TRUE diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 6420d8610e1a..a8d6e7840a85 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -82,7 +82,7 @@ //Hacks var/mob/living/carbon/human/user = usr var/rendered = "[user.name]: [message]" - for(var/mob/living/carbon/human/H in GLOB.living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) var/obj/item/organ/tongue/T = H.getorganslot(ORGAN_SLOT_TONGUE) if(!T || T.type != type) continue

Name

Status

Location

Control