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.
This commit is contained in:
Pickle-Coding
2022-05-09 09:31:47 -07:00
committed by GitHub
parent 92832e43d6
commit d1d9fe7c73
@@ -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))