Remove a whole bunch of in world loops and rework machinery global lists (#3053)

Removes a whole bunch of in world loops.
Reworks SSmachinery to hold two lists: all_machines and processing_machines. all_machines contains all machines 5ever. All of them. Literally. Forever. And ever. processing_machines only contains machines that process with the SSmachinery controller.

I checked most types at runtime on the live server to see whether they're in processing_machines or in all_machines, and did debug to ensure that most machinery ends up and stays in all_machines.

Includes a basic UT to make sure all mapped in machinery types remain within the all_machines list post-init.
This commit is contained in:
skull132
2017-07-16 20:32:33 +03:00
committed by GitHub
parent 4645af8dcb
commit 0fc67f2cb9
70 changed files with 237 additions and 176 deletions
+1 -1
View File
@@ -807,7 +807,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
if("Toggle Door")
if(cartridge && cartridge.access_remote_door)
for(var/obj/machinery/door/blast/M in world)
for(var/obj/machinery/door/blast/M in SSmachinery.all_machines)
if(M.id == cartridge.remote_door_id)
if(M.density)
M.open()
@@ -141,7 +141,7 @@ Frequency:
user << "<span class='notice'>\The [src] is malfunctioning.</span>"
return
var/list/L = list( )
for(var/obj/machinery/teleport/hub/R in world)
for(var/obj/machinery/teleport/hub/R in SSmachinery.all_machines)
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(R.x - 2, R.y, R.z))
if (istype(com, /obj/machinery/computer/teleporter) && com.locked && !com.one_time_use)
if(R.icon_state == "tele1")