From d1d9fe7c733b40bcd2ebf4c2fd9c483dbd0524dd Mon Sep 17 00:00:00 2001 From: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com> Date: Mon, 9 May 2022 17:31:47 +0100 Subject: [PATCH] Freon combustion burn rate is now based on oxygen moles if there isn't enough oxygen for full burn. Fixes freon hotspots. (#66782) For some reason the sign on the if check was reversed, which causes freon burn rate to be based on freon moles instead of oxygen moles if there is lacking oxygen for full burn. Not sure why it got flipped, but I'm just flipping the freon burn rates to correct it, so it should be based on oxygen moles if there isn't enough oxygen for fullburn. Also for some reason freon fires checked if the holder was in a turf before reacting, and returning no reaction if it was not in a turf. This caused cold fire hotspots to kill themselves due to them not being a turf while making the gasmixture react, returning no gas reaction results then setting volume of fire to 0. Fixes that by allowing freon to react in any gasmixture, but it can't create hot ice if it's not in a turf. --- code/modules/atmospherics/gasmixtures/reactions.dm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index ea21f3a2fb9..1ff8be48872 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -391,9 +391,6 @@ ) /datum/gas_reaction/freonfire/react(datum/gas_mixture/air, datum/holder) - if(!isturf(holder)) - return NO_REACTION - var/temperature = air.temperature var/temperature_scale if(temperature < FREON_TERMINAL_TEMPERATURE) //stop the reaction when too cold @@ -409,9 +406,9 @@ var/freon_burn_rate var/list/cached_gases = air.gases if(cached_gases[/datum/gas/oxygen][MOLES] < cached_gases[/datum/gas/freon][MOLES] * FREON_OXYGEN_FULLBURN) - freon_burn_rate = (cached_gases[/datum/gas/freon][MOLES] / FREON_BURN_RATE_DELTA) * temperature_scale - else freon_burn_rate = ((cached_gases[/datum/gas/oxygen][MOLES] / FREON_OXYGEN_FULLBURN) / FREON_BURN_RATE_DELTA) * temperature_scale + else + freon_burn_rate = (cached_gases[/datum/gas/freon][MOLES] / FREON_BURN_RATE_DELTA) * temperature_scale if (freon_burn_rate < MINIMUM_HEAT_CAPACITY) return NO_REACTION @@ -423,7 +420,7 @@ ASSERT_GAS(/datum/gas/carbon_dioxide, air) cached_gases[/datum/gas/carbon_dioxide][MOLES] += freon_burn_rate - if(temperature < HOT_ICE_FORMATION_MAXIMUM_TEMPERATURE && temperature > HOT_ICE_FORMATION_MINIMUM_TEMPERATURE && prob(HOT_ICE_FORMATION_PROB)) + if(temperature < HOT_ICE_FORMATION_MAXIMUM_TEMPERATURE && temperature > HOT_ICE_FORMATION_MINIMUM_TEMPERATURE && prob(HOT_ICE_FORMATION_PROB) && isturf(holder)) new /obj/item/stack/sheet/hot_ice(holder) SET_REACTION_RESULTS(freon_burn_rate * (1 + oxygen_burn_ratio))