From 1e5d19a5b1c2acdabfab1765dc3c1f4fc25be023 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Fri, 12 Aug 2022 21:37:05 -0700 Subject: [PATCH 1/5] make sure ChangeTurf updates air ref on all paths --- code/game/turfs/change_turf.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index bb5ca6da1a..7aae593cdf 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -154,12 +154,13 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( update_air_ref(planetary_atmos ? 1 : 2) QDEL_NULL(stashed_air) else + flags |= CHANGETURF_RECALC_ADJACENT if(ispath(path,/turf/closed)) - flags |= CHANGETURF_RECALC_ADJACENT update_air_ref(-1) . = ..() else . = ..() + update_air_ref(planetary_atmos ? 1 : 2) if(!istype(air,/datum/gas_mixture)) Initalize_Atmos(0) From 69f2170cad52dc61b14ff85d9a7db2b4cb24ceef Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Sun, 14 Aug 2022 23:21:27 -0700 Subject: [PATCH 2/5] thank you unit tests i owe you my life --- code/game/turfs/change_turf.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index 7aae593cdf..8e099d02cc 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -160,9 +160,9 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( . = ..() else . = ..() - update_air_ref(planetary_atmos ? 1 : 2) if(!istype(air,/datum/gas_mixture)) Initalize_Atmos(0) + update_air_ref(planetary_atmos ? 1 : 2) // Take off the top layer turf and replace it with the next baseturf down /turf/proc/ScrapeAway(amount=1, flags) From 39c8742a1d48b9a85335766a21b90a73e90c5394 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Mon, 15 Aug 2022 23:40:28 -0700 Subject: [PATCH 3/5] yeah no brute forcing this screw you --- code/game/turfs/change_turf.dm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index 8e099d02cc..48d4563f51 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -160,9 +160,8 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( . = ..() else . = ..() - if(!istype(air,/datum/gas_mixture)) - Initalize_Atmos(0) - update_air_ref(planetary_atmos ? 1 : 2) + air = null + Initalize_Atmos(0) // Take off the top layer turf and replace it with the next baseturf down /turf/proc/ScrapeAway(amount=1, flags) From 65806b4e9f139c8ea64bd6f689dd9885c4ce263f Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Wed, 17 Aug 2022 00:00:52 -0700 Subject: [PATCH 4/5] please... --- code/game/turfs/change_turf.dm | 5 +++-- code/game/turfs/open.dm | 9 ++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index 48d4563f51..e9a5cb160f 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -156,11 +156,12 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( else flags |= CHANGETURF_RECALC_ADJACENT if(ispath(path,/turf/closed)) + . = ..() update_air_ref(-1) - . = ..() else + qdel(src.air) + src.air = null . = ..() - air = null Initalize_Atmos(0) // Take off the top layer turf and replace it with the next baseturf down diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index aa5e02819c..dcf687d53f 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -218,11 +218,10 @@ flash_color(L, flash_color = "#C80000", flash_time = 10) /turf/open/Initalize_Atmos(times_fired) - if(!blocks_air) - if(!istype(air,/datum/gas_mixture/turf)) - air = new(2500,src) - air.copy_from_turf(src) - update_air_ref(planetary_atmos ? 1 : 2) + if(!istype(air,/datum/gas_mixture/turf)) + air = new(2500,src) + air.copy_from_turf(src) + update_air_ref(planetary_atmos ? 1 : 2) update_visuals() From 4df8538e16e685d2676067f1fd1ae0b41799d020 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Wed, 17 Aug 2022 20:17:45 -0700 Subject: [PATCH 5/5] oh my god i've been reading it wrong --- code/game/turfs/change_turf.dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index e9a5cb160f..a62fc70917 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -151,18 +151,18 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( return var/turf/open/newTurf = . newTurf.air.copy_from(stashed_air) - update_air_ref(planetary_atmos ? 1 : 2) + newTurf.update_air_ref(planetary_atmos ? 1 : 2) QDEL_NULL(stashed_air) else flags |= CHANGETURF_RECALC_ADJACENT if(ispath(path,/turf/closed)) . = ..() - update_air_ref(-1) + var/turf/open/newTurf = . + newTurf.update_air_ref(-1) else - qdel(src.air) - src.air = null . = ..() - Initalize_Atmos(0) + var/turf/open/newTurf = . + newTurf.Initalize_Atmos(0) // Take off the top layer turf and replace it with the next baseturf down /turf/proc/ScrapeAway(amount=1, flags)