[MIRROR] Machine list is now stored in SSmachines | Remove excessive use of global lists for specific machine types [MDB IGNORE] (#22481)

* Machine list is now stored in SSmachines | Remove excessive use of global lists for specific machine types

* Resolve merge conflicts

* Modular adjustments

* destroy this double return on destroy

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: Giz <vinylspiders@gmail.com>
This commit is contained in:
SkyratBot
2023-07-15 22:51:23 -04:00
committed by GitHub
co-authored by Zephyr Giz
parent 05a542d043
commit 0a03e8a2a7
88 changed files with 266 additions and 254 deletions
@@ -92,7 +92,7 @@
grav_field = new(src, 7, TRUE, rand(0, 3))
/obj/effect/anomaly/grav/high/detonate()
for(var/obj/machinery/gravity_generator/main/the_generator in GLOB.machines)
for(var/obj/machinery/gravity_generator/main/the_generator as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/gravity_generator/main))
if(is_station_level(the_generator.z))
the_generator.blackout()
@@ -53,7 +53,7 @@
else //If we still cannot find a home associated with our team, we just pick a random pad and make it our own.
var/list/consoles = list()
for(var/obj/machinery/abductor/console/found_console in GLOB.machines)
for(var/obj/machinery/abductor/console/found_console as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/abductor/console))
consoles += found_console
console = pick(consoles)
if(console)
+1 -1
View File
@@ -340,7 +340,7 @@
var/nuclear_option_odds = 0.1
/obj/item/paper/fluff/junkmail_redpill/Initialize(mapload)
var/obj/machinery/nuclearbomb/selfdestruct/self_destruct = locate() in GLOB.nuke_list
var/obj/machinery/nuclearbomb/selfdestruct/self_destruct = locate() in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/nuclearbomb/selfdestruct)
if(!self_destruct || !prob(nuclear_option_odds)) // 1 in 1000 chance of getting 2 random nuke code characters.
add_raw_text("<i>You need to escape the simulation. Don't forget the numbers, they help you remember:</i> '[rand(0,9)][rand(0,9)][rand(0,9)]...'")
return ..()
+1 -1
View File
@@ -175,7 +175,7 @@
return
//SKYRAT EDIT END
var/list/locations = list()
for(var/obj/machinery/computer/teleporter/computer in GLOB.machines)
for(var/obj/machinery/computer/teleporter/computer as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/computer/teleporter))
var/atom/target = computer.target_ref?.resolve()
if(!target)
computer.target_ref = null
@@ -23,7 +23,7 @@
/obj/machinery/computer/camera_advanced/base_construction/aux/find_spawn_spot()
//Aux base controller. Where the eyeobj will spawn.
var/obj/machinery/computer/auxiliary_base/aux_controller
for(var/obj/machinery/computer/auxiliary_base/potential_aux_console in GLOB.machines)
for(var/obj/machinery/computer/auxiliary_base/potential_aux_console as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/computer/auxiliary_base))
if(istype(get_area(potential_aux_console), allowed_area))
aux_controller = potential_aux_console
break