[MIRROR] Strays away from GLOB.machines when possible [MDB IGNORE] (#17478)

* 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.

* Strays away from GLOB.machines when possible

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-11-16 17:14:48 +01:00
committed by GitHub
parent 48573088e9
commit 618bb34eea
24 changed files with 61 additions and 60 deletions
+3 -3
View File
@@ -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].<br>"
@@ -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].<br>"
@@ -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].<br>"
+2 -2
View File
@@ -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 = {"<B>Camera Abnormalities Report</B><HR>
+3 -3
View File
@@ -56,7 +56,7 @@
GLOB.requests.message_centcom(sender.client, msg)
msg = span_adminnotice("<b><font color=orange>CENTCOM:</font>[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)]:</b> [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("<b><font color=crimson>SYNDICATE:</font>[ADMIN_FULLMONTY(sender)] [ADMIN_SYNDICATE_REPLY(sender)]:</b> [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("<b><font color=orange>NUKE CODE REQUEST:</font>[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)] [ADMIN_SET_SD_CODE]:</b> [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()
+4 -4
View File
@@ -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")