From cb510121b03f3bb43abc3fffdcee28d572bae199 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 20 Nov 2024 00:26:55 -0800 Subject: [PATCH] atmos update_values() enforcement (#6873) --- code/game/objects/items/weapons/flamethrower.dm | 1 + code/modules/admin/verbs/debug.dm | 1 + .../environmental/zas/edges/edge-simulated.dm | 3 +++ .../atmospherics/gasmixtures/gas_mixture.dm | 8 ++++++++ .../atmospherics/machinery/portable/canister.dm | 1 + code/modules/events/atmos_leak.dm | 1 + code/modules/gamemaster/actions/atmos_leak.dm | 1 + code/modules/vore/eating/living_vr.dm | 16 +++++++++------- 8 files changed, 25 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index 0c217e9792e..eaaaa9069fc 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -198,6 +198,7 @@ //air_transfer.toxins = air_transfer.toxins * 5 // This is me not comprehending the air system. I realize this is stupid and I could probably make it work without fucking it up like this, but there you have it. -- TLE new/obj/effect/debris/cleanable/liquid_fuel/flamethrower_fuel(target,air_transfer.gas[GAS_ID_PHORON],get_dir(loc,target)) air_transfer.gas[GAS_ID_PHORON] = 0 + air_transfer.update_values() target.assume_air(air_transfer) //Burn it based on transfered gas //target.hotspot_expose(part4.air_contents.temperature*2,300) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 80f006814d1..fa96e39a4c4 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -551,6 +551,7 @@ var/obj/item/tank/phoron/Phoron = new/obj/item/tank/phoron(Rad) Phoron.air_contents.gas[GAS_ID_PHORON] = 29.1154 //This is a full tank if you filled it from a canister + Phoron.air_contents.update_values() Rad.P = Phoron Phoron.loc = Rad diff --git a/code/modules/atmospherics/environmental/zas/edges/edge-simulated.dm b/code/modules/atmospherics/environmental/zas/edges/edge-simulated.dm index 686a978d0aa..06994bce96a 100644 --- a/code/modules/atmospherics/environmental/zas/edges/edge-simulated.dm +++ b/code/modules/atmospherics/environmental/zas/edges/edge-simulated.dm @@ -106,3 +106,6 @@ / (heat_capacity_A_scaled + heat_capacity_B_scaled) air_A.temperature = average_temperature air_B.temperature = average_temperature + + air_A.update_values() + air_B.update_values() diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index 7dcd2f405cc..035cdcd98f1 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -56,6 +56,9 @@ mixture.temperature = temperature mixture.group_multiplier = group_multiplier mixture.total_moles = total_moles +#ifdef CF_ATMOS_XGM_UPDATE_VALUES_ASSERTIONS + mixture.update_values() +#endif //Takes a gas string and the amount of moles to adjust by. Calls update_values() if update isn't 0. /datum/gas_mixture/proc/adjust_gas(gasid, moles, update = 1) @@ -250,6 +253,8 @@ gasmix.gas = combined.gas.Copy() gasmix.temperature = combined.temperature gasmix.multiply(gasmix.volume) + // todo: is this needed? even if not, it should be compiled in if we're under update values debug assertions + gasmix.update_values() return 1 @@ -309,6 +314,9 @@ gas.len = 0 total_moles = 0 temperature = TCMB +#ifdef CF_ATMOS_XGM_UPDATE_VALUES_ASSERTIONS + debug_gas_archive = list() +#endif /** * get mass in kilograms diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 17bb7ef9e6f..be7402f1ffa 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -527,6 +527,7 @@ update_flag /obj/machinery/portable_atmospherics/canister/nitrous_oxide/roomfiller/Initialize(mapload) . = ..() air_contents.gas[GAS_ID_NITROUS_OXIDE] = 9*4000 + air_contents.update_values() return INITIALIZE_HINT_LATELOAD /obj/machinery/portable_atmospherics/canister/nitrous_oxide/roomfiller/LateInitialize() diff --git a/code/modules/events/atmos_leak.dm b/code/modules/events/atmos_leak.dm index 3e3c87126f7..ea73c395d00 100644 --- a/code/modules/events/atmos_leak.dm +++ b/code/modules/events/atmos_leak.dm @@ -65,5 +65,6 @@ var/datum/gas_mixture/air_contents = new air_contents.temperature = T20C + ((severity - 1) * rand(-50, 50)) air_contents.gas[gas_type] = 10 * CELL_MOLES + air_contents.update_values() target_turf.assume_air(air_contents) playsound(target_turf, 'sound/effects/smoke.ogg', 50, 1) diff --git a/code/modules/gamemaster/actions/atmos_leak.dm b/code/modules/gamemaster/actions/atmos_leak.dm index 9496865369e..183bbcc2295 100644 --- a/code/modules/gamemaster/actions/atmos_leak.dm +++ b/code/modules/gamemaster/actions/atmos_leak.dm @@ -67,6 +67,7 @@ var/datum/gas_mixture/air_contents = new air_contents.temperature = T20C + ((severity - 1) * rand(-50, 50)) air_contents.gas[gas_type] = 10 * CELL_MOLES + air_contents.update_values() target_turf.assume_air(air_contents) playsound(target_turf, 'sound/effects/smoke.ogg', 50, 1) diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index fe443415d1e..d7a14a5e4bf 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -518,15 +518,17 @@ // This is about 0.896m^3 of atmosphere /datum/gas_mixture/belly_air - volume = 2500 - temperature = 293.150 - total_moles = 104 + volume = 2500 + temperature = 293.150 + total_moles = 104 /datum/gas_mixture/belly_air/New() - . = ..() - gas = list( - GAS_ID_OXYGEN = 21, - GAS_ID_NITROGEN = 79) + . = ..() + gas = list( + GAS_ID_OXYGEN = 21, + GAS_ID_NITROGEN = 79, + ) + update_values() // Procs for micros stuffed into boots and the like to escape from them /mob/living/proc/escape_clothes(obj/item/clothing/C)