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.
This commit is contained in:
John Willard
2022-11-15 08:59:22 -08:00
committed by GitHub
parent 9ad2d34ee6
commit ac8dc42060
24 changed files with 61 additions and 60 deletions
+3 -3
View File
@@ -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))