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:
Zephyr
2023-07-15 16:17:46 -04:00
committed by GitHub
parent c1c41a0b22
commit f71ea26f72
82 changed files with 259 additions and 246 deletions
@@ -119,7 +119,6 @@ GLOBAL_LIST_EMPTY(TabletMessengers) // a list of all active messengers, similar
/obj/item/modular_computer/Initialize(mapload)
. = ..()
START_PROCESSING(SSobj, src)
if(!physical)
physical = src
@@ -123,7 +123,7 @@
chatprogram.username = "cargo_requests_operator"
var/datum/ntnet_conversation/cargochat = chatprogram.create_new_channel("#cargobus", strong = TRUE)
for(var/obj/machinery/modular_computer/preset/cargochat/cargochat_console in GLOB.machines)
for(var/obj/machinery/modular_computer/preset/cargochat/cargochat_console as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/modular_computer/preset/cargochat))
if(cargochat_console == src)
continue
var/datum/computer_file/program/chatclient/other_chatprograms = cargochat_console.cpu.find_file_by_name("ntnrc_client")