From afca7f1d0912aff7575ab39abf4609589e0ecdeb Mon Sep 17 00:00:00 2001 From: kevinz000 Date: Thu, 2 Nov 2017 21:30:29 -0700 Subject: [PATCH] [READY]Helps address atmospherics nullspace runtimes (#32281) * Helps fix atmospherics nullspace runtimes, adds debugging to pipe caches and makes the list accessible. * I can spell properly guys * Ok ok ok no global! * Update construction.dm --- code/controllers/subsystem/air.dm | 1 + code/game/machinery/pipe/construction.dm | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index b5dbabb934..90690c934a 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -27,6 +27,7 @@ SUBSYSTEM_DEF(air) var/list/hotspots = list() var/list/networks = list() var/list/obj/machinery/atmos_machinery = list() + var/list/pipe_construction_generation_cache = list() diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 5d529defea..eb79ab72f3 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -148,13 +148,15 @@ Buildable meters return rotate() /obj/item/pipe/proc/get_pipe_cache(type, direction) - var/static/list/obj/machinery/atmospherics/check_cache + var/list/obj/machinery/atmospherics/check_cache = SSair.pipe_construction_generation_cache if(!islist(check_cache)) check_cache = list() if(!check_cache[type]) check_cache[type] = list() if(!check_cache[type]["[direction]"]) - check_cache[type]["[direction]"] = new type(null, null, direction) + var/obj/machinery/atmospherics/A = new type(null, FALSE, direction) + A.name = "\[CACHE\] [A.name]" + check_cache[type]["[direction]"] = A return check_cache[type]["[direction]"]