From ac8dc4206090b44363cf1cee8902edac82abcede Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Tue, 15 Nov 2022 11:59:22 -0500 Subject: [PATCH] Strays away from GLOB.machines when possible (#71100) ## About The Pull Request This replaces needless GLOB.machines with more precise lists whenever one existed, plus adding a new one for CTF machines. ## Why It's Good For The Game GLOB.machines holds every single /obj/machinery in the game, so checking the whole list for stuff is pretty big. This aims to cut that down by using smaller lists whenever possible. I also gave CTF a new list because it checked machines very often. ## Changelog Nothing player facing. --- code/controllers/subsystem/communications.dm | 2 +- code/datums/world_topic.dm | 2 +- code/game/gamemodes/events.dm | 5 ++-- code/game/machinery/camera/tracking.dm | 2 +- code/game/machinery/computer/camera.dm | 2 +- .../machinery/computer/camera_advanced.dm | 4 ++-- .../embedded_controller/access_controller.dm | 2 +- code/game/objects/items/devices/camera_bug.dm | 2 +- code/modules/admin/verbs/debug.dm | 6 ++--- code/modules/admin/verbs/mapping.dm | 4 ++-- code/modules/admin/verbs/pray.dm | 6 ++--- code/modules/admin/verbs/secrets.dm | 8 +++---- .../traitor/equipment/Malf_Modules.dm | 10 ++++---- .../final_objective/supermatter_cascade.dm | 10 ++++---- code/modules/assembly/doorcontrol.dm | 6 ++--- code/modules/capture_the_flag/ctf_game.dm | 24 ++++++++++--------- code/modules/capture_the_flag/ctf_panel.dm | 6 +++-- .../industrial_lift/tram_lift_master.dm | 2 +- code/modules/mafia/controller.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 3 +-- .../living/silicon/ai/freelook/cameranet.dm | 2 +- .../file_system/programs/secureye.dm | 2 +- code/modules/station_goals/dna_vault.dm | 5 ++-- code/modules/station_goals/station_goal.dm | 4 ++-- 24 files changed, 61 insertions(+), 60 deletions(-) diff --git a/code/controllers/subsystem/communications.dm b/code/controllers/subsystem/communications.dm index ddb058b5f79..d9408aa0dc6 100644 --- a/code/controllers/subsystem/communications.dm +++ b/code/controllers/subsystem/communications.dm @@ -66,7 +66,7 @@ SUBSYSTEM_DEF(communications) message_admins("[ADMIN_LOOKUPFLW(user)] has called an emergency meeting.") /datum/controller/subsystem/communications/proc/send_message(datum/comm_message/sending,print = TRUE,unique = FALSE) - for(var/obj/machinery/computer/communications/C in GLOB.machines) + for(var/obj/machinery/computer/communications/C in GLOB.shuttle_caller_list) if(!(C.machine_stat & (BROKEN|NOPOWER)) && is_station_level(C.z)) if(unique) C.add_message(sending) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 30cf5cd7dbc..ee59609c9a0 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -154,7 +154,7 @@ minor_announce(input["message"], "Incoming message from [input["message_sender"]]") message_admins("Receiving a message from [input["sender_ckey"]] at [input["source"]]") - for(var/obj/machinery/computer/communications/communications_console in GLOB.machines) + for(var/obj/machinery/computer/communications/communications_console in GLOB.shuttle_caller_list) communications_console.override_cooldown() /datum/world_topic/news_report diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index b4cbbe99153..2829acccb82 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -10,7 +10,7 @@ S.update_appearance() S.power_change() - for(var/area/A in GLOB.the_station_areas) + for(var/area/A as anything in GLOB.the_station_areas) if(!A.requires_power || A.always_unpowered ) continue if(GLOB.typecache_powerfailure_safe_areas[A.type]) @@ -30,9 +30,8 @@ C.cell.charge = 0 /proc/power_restore() - priority_announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", ANNOUNCER_POWERON) - for(var/obj/machinery/power/apc/C in GLOB.machines) + for(var/obj/machinery/power/apc/C in GLOB.apcs_list) if(C.cell && is_station_level(C.z)) C.cell.charge = C.cell.maxcharge COOLDOWN_RESET(C, failure_timer) diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 00c8eb6c5ac..1228930a7a2 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -1,6 +1,6 @@ /mob/living/silicon/ai/proc/get_camera_list() var/list/L = list() - for (var/obj/machinery/camera/C in GLOB.cameranet.cameras) + for (var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras) L.Add(C) camera_sort(L) diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 161ecf71e6b..0d9c9579852 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -179,7 +179,7 @@ // Returns the list of cameras accessible from this computer /obj/machinery/computer/security/proc/get_available_cameras() var/list/L = list() - for (var/obj/machinery/camera/C in GLOB.cameranet.cameras) + for (var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras) if((is_away_level(z) || is_away_level(C.z)) && (C.z != z))//if on away mission, can only receive feed from same z_level cameras continue L.Add(C) diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index c5149c06e11..4e5fda9b1db 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -141,7 +141,7 @@ if((!length(z_lock) || (myturf.z in z_lock)) && GLOB.cameranet.checkTurfVis(myturf)) camera_location = myturf else - for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) + for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras) if(!C.can_use() || length(z_lock) && !(C.z in z_lock)) continue var/list/network_overlap = networks & C.network @@ -277,7 +277,7 @@ var/list/L = list() - for (var/obj/machinery/camera/cam in GLOB.cameranet.cameras) + for (var/obj/machinery/camera/cam as anything in GLOB.cameranet.cameras) if(length(origin.z_lock) && !(cam.z in origin.z_lock)) continue L.Add(cam) diff --git a/code/game/machinery/embedded_controller/access_controller.dm b/code/game/machinery/embedded_controller/access_controller.dm index b4a2d76110a..999a6afa5e9 100644 --- a/code/game/machinery/embedded_controller/access_controller.dm +++ b/code/game/machinery/embedded_controller/access_controller.dm @@ -53,7 +53,7 @@ if(A.idSelf == idSelf) controller = A break - for(var/obj/machinery/door/airlock/I in GLOB.machines) + for(var/obj/machinery/door/airlock/I in GLOB.airlocks) if(I.id_tag == idDoor) door = I break diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm index f5fb9321c54..918b7313691 100644 --- a/code/game/objects/items/devices/camera_bug.dm +++ b/code/game/objects/items/devices/camera_bug.dm @@ -77,7 +77,7 @@ /obj/item/camera_bug/proc/get_cameras() if( world.time > (last_net_update + 100)) bugged_cameras = list() - for(var/obj/machinery/camera/camera in GLOB.cameranet.cameras) + for(var/obj/machinery/camera/camera as anything in GLOB.cameranet.cameras) if(camera.machine_stat || !camera.can_use()) continue if(length(list("ss13","mine", "rd", "labor", "ordnance", "minisat") & camera.network)) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 82a534c64ba..e40587a71af 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -321,7 +321,7 @@ areas_with_air_alarm.Add(A.type) CHECK_TICK - for(var/obj/machinery/requests_console/RC in GLOB.machines) + for(var/obj/machinery/requests_console/RC in GLOB.allConsoles) var/area/A = get_area(RC) if(!A) dat += "Skipped over [RC] in invalid location, [RC.loc].
" @@ -348,7 +348,7 @@ areas_with_LS.Add(A.type) CHECK_TICK - for(var/obj/item/radio/intercom/I in GLOB.machines) + for(var/obj/item/radio/intercom/I as anything in GLOB.intercoms_list) var/area/A = get_area(I) if(!A) dat += "Skipped over [I] in invalid location, [I.loc].
" @@ -357,7 +357,7 @@ areas_with_intercom.Add(A.type) CHECK_TICK - for(var/obj/machinery/camera/C in GLOB.machines) + for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras) var/area/A = get_area(C) if(!A) dat += "Skipped over [C] in invalid location, [C.loc].
" diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index afb2c80bbfe..45ebd81ac7a 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -71,7 +71,7 @@ GLOBAL_PROTECT(admin_verbs_debug_mapping) if(!on) var/list/seen = list() - for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) + for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras) for(var/turf/T in C.can_see()) seen[T]++ for(var/turf/T in seen) @@ -106,7 +106,7 @@ GLOBAL_LIST_EMPTY(dirty_vars) var/list/obj/machinery/camera/CL = list() - for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) + for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras) CL += C var/output = {"Camera Abnormalities Report
diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index 5c8e664ea8c..7d0f09eb72a 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -56,7 +56,7 @@ GLOB.requests.message_centcom(sender.client, msg) msg = span_adminnotice("CENTCOM:[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)]: [msg]") to_chat(GLOB.admins, msg, confidential = TRUE) - for(var/obj/machinery/computer/communications/console in GLOB.machines) + for(var/obj/machinery/computer/communications/console in GLOB.shuttle_caller_list) console.override_cooldown() /// Used by communications consoles to message the Syndicate @@ -65,7 +65,7 @@ GLOB.requests.message_syndicate(sender.client, msg) msg = span_adminnotice("SYNDICATE:[ADMIN_FULLMONTY(sender)] [ADMIN_SYNDICATE_REPLY(sender)]: [msg]") to_chat(GLOB.admins, msg, confidential = TRUE) - for(var/obj/machinery/computer/communications/console in GLOB.machines) + for(var/obj/machinery/computer/communications/console in GLOB.shuttle_caller_list) console.override_cooldown() /// Used by communications consoles to request the nuclear launch codes @@ -74,5 +74,5 @@ GLOB.requests.nuke_request(sender.client, msg) msg = span_adminnotice("NUKE CODE REQUEST:[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)] [ADMIN_SET_SD_CODE]: [msg]") to_chat(GLOB.admins, msg, confidential = TRUE) - for(var/obj/machinery/computer/communications/console in GLOB.machines) + for(var/obj/machinery/computer/communications/console in GLOB.shuttle_caller_list) console.override_cooldown() diff --git a/code/modules/admin/verbs/secrets.dm b/code/modules/admin/verbs/secrets.dm index 8e5118692f1..bbe5282e850 100644 --- a/code/modules/admin/verbs/secrets.dm +++ b/code/modules/admin/verbs/secrets.dm @@ -70,16 +70,16 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller) if("maint_access_engiebrig") if(!is_debugger) return - for(var/obj/machinery/door/airlock/maintenance/M in GLOB.machines) + for(var/obj/machinery/door/airlock/maintenance/M in GLOB.airlocks) M.check_access() if (ACCESS_MAINT_TUNNELS in M.req_access) M.req_access = list() - M.req_one_access = list(ACCESS_BRIG,ACCESS_ENGINEERING) + M.req_one_access = list(ACCESS_BRIG, ACCESS_ENGINEERING) message_admins("[key_name_admin(holder)] made all maint doors engineering and brig access-only.") if("maint_access_brig") if(!is_debugger) return - for(var/obj/machinery/door/airlock/maintenance/M in GLOB.machines) + for(var/obj/machinery/door/airlock/maintenance/M in GLOB.airlocks) M.check_access() if (ACCESS_MAINT_TUNNELS in M.req_access) M.req_access = list(ACCESS_BRIG) @@ -324,7 +324,7 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller) if(!is_funmin) return SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Egalitarian Station")) - for(var/obj/machinery/door/airlock/W in GLOB.machines) + for(var/obj/machinery/door/airlock/W in GLOB.airlocks) if(is_station_level(W.z) && !istype(get_area(W), /area/station/command) && !istype(get_area(W), /area/station/commons) && !istype(get_area(W), /area/station/service) && !istype(get_area(W), /area/station/command/heads_quarters) && !istype(get_area(W), /area/station/security/prison)) W.req_access = list() message_admins("[key_name_admin(holder)] activated Egalitarian Station mode") diff --git a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm index 02fedb462e6..31bf889fca1 100644 --- a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm +++ b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm @@ -366,7 +366,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module)) INVOKE_ASYNC(D, TYPE_PROC_REF(/obj/machinery/door, hostile_lockdown), owner) addtimer(CALLBACK(D, TYPE_PROC_REF(/obj/machinery/door, disable_lockdown)), 900) - var/obj/machinery/computer/communications/C = locate() in GLOB.machines + var/obj/machinery/computer/communications/C = locate() in GLOB.shuttle_caller_list if(C) C.post_status("alert", "lockdown") @@ -560,7 +560,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module)) /datum/action/innate/ai/honk/Activate() to_chat(owner, span_clown("The intercom system plays your prepared file as commanded.")) - for(var/obj/item/radio/intercom/found_intercom in GLOB.intercoms_list) + for(var/obj/item/radio/intercom/found_intercom as anything in GLOB.intercoms_list) if(!found_intercom.is_on() || !found_intercom.get_listening() || found_intercom.wires.is_cut(WIRE_RX)) //Only operating intercoms play the honk continue found_intercom.audible_message(message = "[found_intercom] crackles for a split second.", hearing_distance = 3) @@ -750,10 +750,9 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module)) /datum/action/innate/ai/reactivate_cameras/Activate() var/fixed_cameras = 0 - for(var/V in GLOB.cameranet.cameras) + for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras) if(!uses) break - var/obj/machinery/camera/C = V if(!C.status || C.view_range != initial(C.view_range)) C.toggle_cam(owner_AI, 0) //Reactivates the camera based on status. Badly named proc. C.view_range = initial(C.view_range) @@ -782,8 +781,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module)) AI.update_sight() var/upgraded_cameras = 0 - for(var/V in GLOB.cameranet.cameras) - var/obj/machinery/camera/C = V + for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras) var/obj/structure/camera_assembly/assembly = C.assembly_ref?.resolve() if(assembly) var/upgraded = FALSE diff --git a/code/modules/antagonists/traitor/objectives/final_objective/supermatter_cascade.dm b/code/modules/antagonists/traitor/objectives/final_objective/supermatter_cascade.dm index 3c704a4331d..387e6049983 100644 --- a/code/modules/antagonists/traitor/objectives/final_objective/supermatter_cascade.dm +++ b/code/modules/antagonists/traitor/objectives/final_objective/supermatter_cascade.dm @@ -13,11 +13,13 @@ if(!.) return FALSE - for(var/obj/machinery/power/supermatter_crystal/engine/crystal in GLOB.machines) - if(is_station_level(crystal.z) || is_mining_level(crystal.z)) - return TRUE + if(isnull(GLOB.main_supermatter_engine)) + return FALSE + var/obj/machinery/power/supermatter_crystal/engine/crystal = locate() in GLOB.main_supermatter_engine + if(!is_station_level(crystal.z) && !is_mining_level(crystal.z)) + return FALSE - return FALSE + return TRUE /datum/traitor_objective/ultimate/supermatter_cascade/generate_objective(datum/mind/generating_for, list/possible_duplicates) var/list/possible_areas = GLOB.the_station_areas.Copy() diff --git a/code/modules/assembly/doorcontrol.dm b/code/modules/assembly/doorcontrol.dm index 71980ee8d36..82ffd1b3c42 100644 --- a/code/modules/assembly/doorcontrol.dm +++ b/code/modules/assembly/doorcontrol.dm @@ -25,7 +25,7 @@ if(cooldown) return cooldown = TRUE - for(var/obj/machinery/door/poddoor/M in GLOB.machines) + for(var/obj/machinery/door/poddoor/M in GLOB.airlocks) if(M.id == src.id) if(openclose == null || !sync_doors) openclose = M.density @@ -107,7 +107,7 @@ if(cooldown) return cooldown = TRUE - for(var/obj/machinery/door/poddoor/M in GLOB.machines) + for(var/obj/machinery/door/poddoor/M in GLOB.airlocks) if (M.id == src.id) INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/machinery/door/poddoor, open)) @@ -119,7 +119,7 @@ sleep(6 SECONDS) - for(var/obj/machinery/door/poddoor/M in GLOB.machines) + for(var/obj/machinery/door/poddoor/M in GLOB.airlocks) if (M.id == src.id) INVOKE_ASYNC(M, TYPE_PROC_REF(/obj/machinery/door/poddoor, close)) diff --git a/code/modules/capture_the_flag/ctf_game.dm b/code/modules/capture_the_flag/ctf_game.dm index ef81f1072e2..47736ef2fbe 100644 --- a/code/modules/capture_the_flag/ctf_game.dm +++ b/code/modules/capture_the_flag/ctf_game.dm @@ -187,7 +187,7 @@ to_chat(user, span_warning("CTF cannot be unloaded if it was not loaded in the first place")) return to_chat(user, span_warning("CTF is being unloaded")) - for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) + for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines) CTF.unload() log_admin("[key_name_admin(user)] has unloaded CTF.") message_admins("[key_name_admin(user)] has unloaded CTF.") @@ -214,7 +214,7 @@ var/ctf_enabled = FALSE var/area/A - for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) + for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines) if(activated_id != CTF.game_id) continue ctf_enabled = CTF.toggle_ctf() @@ -276,12 +276,14 @@ /obj/machinery/capture_the_flag/Initialize(mapload) . = ..() + GLOB.ctf_panel.ctf_machines += src SSpoints_of_interest.make_point_of_interest(src) default_gear = ctf_gear ctf_landmark = GLOB.ctf_spawner /obj/machinery/capture_the_flag/Destroy() ctf_landmark = null + GLOB.ctf_panel.ctf_machines -= src return ..() /obj/machinery/capture_the_flag/process(delta_time) @@ -344,7 +346,7 @@ if(!(GLOB.ghost_role_flags & GHOSTROLE_MINIGAME)) to_chat(user, span_warning("CTF has been temporarily disabled by admins.")) return - for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) + for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines) if(CTF.game_id != game_id && CTF.ctf_enabled) to_chat(user, span_warning("There is already an ongoing game in the [get_area(CTF)]!")) return @@ -363,7 +365,7 @@ spawn_team_member(new_team_member) return - for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) + for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines) if(CTF.game_id != game_id || CTF == src || CTF.ctf_enabled == FALSE) continue if(user.ckey in CTF.team_members) @@ -464,7 +466,7 @@ competitor.dropItemToGround(W) competitor.dust() control_point_reset() - for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) + for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines) if(CTF.game_id != game_id) continue if(CTF.ctf_enabled == TRUE) @@ -522,14 +524,14 @@ machine_reset(src) /obj/machinery/capture_the_flag/proc/instagib_mode() - for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) + for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines) if(CTF.game_id != game_id) continue CTF.ctf_gear = CTF.instagib_gear CTF.respawn_cooldown = INSTAGIB_RESPAWN /obj/machinery/capture_the_flag/proc/normal_mode() - for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) + for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines) if(CTF.game_id != game_id) continue CTF.ctf_gear = CTF.default_gear @@ -601,13 +603,13 @@ /obj/effect/ctf/dead_barricade/Initialize(mapload) . = ..() - for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) + for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines) if(CTF.game_id != game_id) continue CTF.dead_barricades += src /obj/effect/ctf/dead_barricade/Destroy() - for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) + for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines) if(CTF.game_id != game_id) continue CTF.dead_barricades -= src @@ -649,7 +651,7 @@ /obj/machinery/control_point/proc/capture(mob/user) if(do_after(user, 30, target = src)) - for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) + for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines) if(CTF.ctf_enabled && (user.ckey in CTF.team_members)) controlling = CTF icon_state = "dominator-[CTF.team]" @@ -665,7 +667,7 @@ . = TRUE if(ishuman(target)) var/mob/living/carbon/human/H = target - for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) + for(var/obj/machinery/capture_the_flag/CTF as anything in GLOB.ctf_panel.ctf_machines) if(H in CTF.spawned_mobs) . = TRUE break diff --git a/code/modules/capture_the_flag/ctf_panel.dm b/code/modules/capture_the_flag/ctf_panel.dm index ed836be432f..07b82e7bad0 100644 --- a/code/modules/capture_the_flag/ctf_panel.dm +++ b/code/modules/capture_the_flag/ctf_panel.dm @@ -1,6 +1,8 @@ GLOBAL_DATUM_INIT(ctf_panel, /datum/ctf_panel, new()) /datum/ctf_panel + ///List of all CTF machines + var/list/obj/machinery/capture_the_flag/ctf_machines = list() /datum/ctf_panel/ui_state(mob/user) return GLOB.observer_state @@ -15,7 +17,7 @@ GLOBAL_DATUM_INIT(ctf_panel, /datum/ctf_panel, new()) var/list/data = list() var/list/teams = list() - for(var/obj/machinery/capture_the_flag/team in GLOB.machines) + for(var/obj/machinery/capture_the_flag/team as anything in GLOB.ctf_panel.ctf_machines) if (!team.ctf_enabled) continue @@ -79,7 +81,7 @@ GLOBAL_DATUM_INIT(ctf_panel, /datum/ctf_panel, new()) return TRUE /datum/ctf_panel/proc/ctf_enabled() - for (var/obj/machinery/capture_the_flag/ctf_machine in GLOB.machines) + for (var/obj/machinery/capture_the_flag/ctf_machine as anything in GLOB.ctf_panel.ctf_machines) if (ctf_machine.ctf_enabled) return TRUE diff --git a/code/modules/industrial_lift/tram_lift_master.dm b/code/modules/industrial_lift/tram_lift_master.dm index beaa1d9dc1e..0e1c10902ec 100644 --- a/code/modules/industrial_lift/tram_lift_master.dm +++ b/code/modules/industrial_lift/tram_lift_master.dm @@ -183,7 +183,7 @@ * The tram doors are in a list of tram_doors and we apply the proc on that list. */ /datum/lift_master/tram/proc/update_tram_doors(action) - for(var/obj/machinery/door/window/tram_door in GLOB.machines) + for(var/obj/machinery/door/window/tram_door in GLOB.airlocks) if(tram_door.associated_lift != specific_lift_id) continue switch(action) diff --git a/code/modules/mafia/controller.dm b/code/modules/mafia/controller.dm index 894c415b281..70020d7368f 100644 --- a/code/modules/mafia/controller.dm +++ b/code/modules/mafia/controller.dm @@ -412,7 +412,7 @@ * * close: boolean, the state you want the curtains in. */ /datum/mafia_controller/proc/toggle_night_curtains(close) - for(var/obj/machinery/door/poddoor/D in GLOB.machines) //I really dislike pathing of these + for(var/obj/machinery/door/poddoor/D in GLOB.airlocks) //I really dislike pathing of these if(D.id != "mafia") //so as to not trigger shutters on station, lol continue if(close) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index ee306a92b95..18c4b1f0964 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -332,8 +332,7 @@ // hack to display shuttle timer if(!EMERGENCY_IDLE_OR_RECALLED) - var/obj/machinery/computer/communications/C = locate() in GLOB.machines - if(C) + for(var/obj/machinery/computer/communications/C in GLOB.shuttle_caller_list) C.post_status("shuttle") /mob/living/silicon/ai/can_interact_with(atom/A, treat_mob_as_adjacent) diff --git a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm index b04f9ccbc41..87f0d6f7f75 100644 --- a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm +++ b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm @@ -12,7 +12,7 @@ GLOBAL_DATUM_INIT(cameranet, /datum/cameranet, new) var/name = "Camera Net" /// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del(). - var/list/cameras = list() + var/list/obj/machinery/camera/cameras = list() /// The chunks of the map, mapping the areas that the cameras can see. var/list/chunks = list() var/ready = 0 diff --git a/code/modules/modular_computers/file_system/programs/secureye.dm b/code/modules/modular_computers/file_system/programs/secureye.dm index 30a4acffa51..44a1262ab5e 100644 --- a/code/modules/modular_computers/file_system/programs/secureye.dm +++ b/code/modules/modular_computers/file_system/programs/secureye.dm @@ -171,7 +171,7 @@ // Returns the list of cameras accessible from this computer /datum/computer_file/program/secureye/proc/get_available_cameras() var/list/L = list() - for (var/obj/machinery/camera/cam in GLOB.cameranet.cameras) + for (var/obj/machinery/camera/cam as anything in GLOB.cameranet.cameras) if(!is_station_level(cam.z))//Only show station cameras. continue L.Add(cam) diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm index 27851982bd2..ee692f83046 100644 --- a/code/modules/station_goals/dna_vault.dm +++ b/code/modules/station_goals/dna_vault.dm @@ -110,11 +110,10 @@ return ..() /obj/machinery/dna_vault/Destroy() - for(var/V in fillers) - var/obj/structure/filler/filler = V + for(var/obj/structure/filler/filler as anything in fillers) filler.parent = null qdel(filler) - . = ..() + return ..() /obj/machinery/dna_vault/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) diff --git a/code/modules/station_goals/station_goal.dm b/code/modules/station_goals/station_goal.dm index 1afd6a6cded..30ed0b78b6c 100644 --- a/code/modules/station_goals/station_goal.dm +++ b/code/modules/station_goals/station_goal.dm @@ -26,13 +26,13 @@ GLOBAL_LIST_EMPTY_TYPED(station_goals, /datum/station_goal) /datum/station_goal/proc/get_result() if(check_completion()) - return "
  • [name] : [span_greentext("Completed!")]
  • " + return "
  • [name] : [span_greentext("Completed!")]
  • " else return "
  • [name] : [span_redtext("Failed!")]
  • " /datum/station_goal/Destroy() GLOB.station_goals -= src - . = ..() + return ..() /datum/station_goal/Topic(href, href_list) ..()