diff --git a/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer_reactions.dm b/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer_reactions.dm index ad31d80aa54..c393436d5a7 100644 --- a/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer_reactions.dm +++ b/code/modules/atmospherics/machinery/components/electrolyzer/electrolyzer_reactions.dm @@ -50,11 +50,15 @@ GLOBAL_LIST_INIT(electrolyzer_reactions, electrolyzer_reactions_list()) /datum/electrolyzer_reaction/h2o_conversion/react(turf/location, datum/gas_mixture/air_mixture, working_power) + var/old_heat_capacity = air_mixture.heat_capacity() air_mixture.assert_gases(/datum/gas/water_vapor, /datum/gas/oxygen, /datum/gas/hydrogen) var/proportion = min(air_mixture.gases[/datum/gas/water_vapor][MOLES] * INVERSE(2), (2.5 * (working_power ** 2))) air_mixture.gases[/datum/gas/water_vapor][MOLES] -= proportion * 2 air_mixture.gases[/datum/gas/oxygen][MOLES] += proportion air_mixture.gases[/datum/gas/hydrogen][MOLES] += proportion * 2 + var/new_heat_capacity = air_mixture.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air_mixture.temperature = max(air_mixture.temperature * old_heat_capacity / new_heat_capacity, TCMB) /datum/electrolyzer_reaction/nob_conversion name = "Hypernob conversion" @@ -73,10 +77,14 @@ GLOBAL_LIST_INIT(electrolyzer_reactions, electrolyzer_reactions_list()) /datum/electrolyzer_reaction/nob_conversion/react(turf/location, datum/gas_mixture/air_mixture, working_power) + var/old_heat_capacity = air_mixture.heat_capacity() air_mixture.assert_gases(/datum/gas/hypernoblium, /datum/gas/antinoblium) var/proportion = min(air_mixture.gases[/datum/gas/hypernoblium][MOLES], (1.5 * (working_power ** 2))) air_mixture.gases[/datum/gas/hypernoblium][MOLES] -= proportion air_mixture.gases[/datum/gas/antinoblium][MOLES] += proportion * 0.5 + var/new_heat_capacity = air_mixture.heat_capacity() + if(new_heat_capacity > MINIMUM_HEAT_CAPACITY) + air_mixture.temperature = max(air_mixture.temperature * old_heat_capacity / new_heat_capacity, TCMB) /datum/electrolyzer_reaction/halon_generation name = "Halon generation"