mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
Machine list is now stored in SSmachines | Remove excessive use of global lists for specific machine types (#76822)
## About The Pull Request Removes all of the duplicate global lists for specific machine types where the only thing they do is store all machines of that type. Adds machine tracking to SSmachines in the form of a list for all machines, and then an associative list for machines by their type. Previously we have machines in multiple global lists, such as airlocks being in GLOB.doors, GLOB.airlocks, GLOB.machines. This makes that not a thing, and also means that iterating through GLOB.machines looking for a specific type is no longer as expensive.
This commit is contained in:
@@ -7,19 +7,19 @@
|
||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Check Plumbing") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
||||
|
||||
//all plumbing - yes, some things might get stated twice, doesn't matter.
|
||||
for(var/obj/machinery/atmospherics/components/pipe in GLOB.machines)
|
||||
for(var/obj/machinery/atmospherics/components/pipe as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/atmospherics/components))
|
||||
if(pipe.z && (!pipe.nodes || !pipe.nodes.len || (null in pipe.nodes)))
|
||||
to_chat(usr, "Unconnected [pipe.name] located at [ADMIN_VERBOSEJMP(pipe)]", confidential = TRUE)
|
||||
|
||||
//Pipes
|
||||
for(var/obj/machinery/atmospherics/pipe/pipe in GLOB.machines)
|
||||
for(var/obj/machinery/atmospherics/pipe/pipe as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/atmospherics/pipe))
|
||||
if(istype(pipe, /obj/machinery/atmospherics/pipe/smart) || istype(pipe, /obj/machinery/atmospherics/pipe/layer_manifold))
|
||||
continue
|
||||
if(pipe.z && (!pipe.nodes || !pipe.nodes.len || (null in pipe.nodes)))
|
||||
to_chat(usr, "Unconnected [pipe.name] located at [ADMIN_VERBOSEJMP(pipe)]", confidential = TRUE)
|
||||
|
||||
//Nodes
|
||||
for(var/obj/machinery/atmospherics/node1 in GLOB.machines)
|
||||
for(var/obj/machinery/atmospherics/node1 as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/atmospherics))
|
||||
for(var/obj/machinery/atmospherics/node2 in node1.nodes)
|
||||
if(!(node1 in node2.nodes))
|
||||
to_chat(usr, "One-way connection in [node1.name] located at [ADMIN_VERBOSEJMP(node1)]", confidential = TRUE)
|
||||
|
||||
Reference in New Issue
Block a user