From 45fe5c80b1d3e107afc664d5157af65f82b7fe39 Mon Sep 17 00:00:00 2001 From: mafemergency Date: Mon, 2 May 2022 23:35:22 -0400 Subject: [PATCH] fixes firelocks et al. preventing the movement of air (#17539) Co-authored-by: mafemergency --- code/controllers/subsystem/air.dm | 15 ++++++++++----- code/modules/awaymissions/zlevel.dm | 5 ++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index 6df1d4a1ba4..1dbee3f8b2c 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -278,6 +278,14 @@ SUBSYSTEM_DEF(air) T.excited_group.garbage_collect() /datum/controller/subsystem/air/proc/add_to_active(turf/simulated/T, blockchanges = 1) + if(!initialized) + /* it makes no sense to "activate" turfs before setup_allturfs is + called, as setup_allturfs would simply cull the list incorrectly. + only /turf/simulated/Initialize_Atmos() is blessed enough to + activate turfs during this phase of initialization, as it happens + post-cull and inlines the logic (perhaps incorrectly) */ + return + if(istype(T) && T.air) T.excited = 1 active_turfs |= T @@ -290,11 +298,8 @@ SUBSYSTEM_DEF(air) add_to_active(S) /datum/controller/subsystem/air/proc/setup_allturfs(list/turfs_to_init = block(locate(1, 1, 1), locate(world.maxx, world.maxy, world.maxz))) - var/list/active_turfs = src.active_turfs - - // Clear active turfs - faster than removing every single turf in the world - // one-by-one, and Initalize_Atmos only ever adds `src` back in. - active_turfs.Cut() + if(active_turfs.len) + log_debug("failed sanity check: active_turfs is not empty before initialization ([active_turfs.len])") for(var/thing in turfs_to_init) var/turf/T = thing diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm index 80326a6c141..5ce4f211d6b 100644 --- a/code/modules/awaymissions/zlevel.dm +++ b/code/modules/awaymissions/zlevel.dm @@ -7,7 +7,10 @@ smoothTurfs = turfs log_debug("Setting up atmos") - if(SSair) + /* setup_allturfs is superfluous during server initialization because + air subsystem will call subsequently call setup_allturfs with _every_ + turf in the world */ + if(SSair && SSair.initialized) SSair.setup_allturfs(turfs) log_debug("\tTook [stop_watch(subtimer)]s")