[MIRROR] HFR: Respect moderator heat_output effects (#2784)

* HFR: Respect moderator heat_output effects (#56248)

The additional heat users were supposed to deal with when producing
higher tier gases with Proto-Nitrate, and the reduced heat output that
came from managing to run a mix with enough Freon without also killing
the reaction, was being silently discarded because the temperature
adjustment was applied before heat_output was modified.

The changed value would still show up in the UI, but would have no effect
since the application used the pre-modification value.

While internal_fusion has gases added and removed directly as part of
the gas consumption and producion process, no reference to temperature
is made, so it's safe to just move the application of internal_fusion's
temperature change to immediately after the gas consumption and production
process, instead of immediately before it.

* HFR: Respect moderator heat_output effects

Co-authored-by: esainane <esainane+github@gmail.com>
This commit is contained in:
SkyratBot
2021-01-19 11:36:24 +01:00
committed by GitHub
parent 9bc36807a2
commit eecdc093bd
@@ -919,12 +919,6 @@
//The amount of heat that is finally emitted, based on the power output. Min and max are variables that depends of the modifier
heat_output = clamp(internal_instability * power_output * heat_modifier / 100, - heat_limiter_modifier * 0.01, heat_limiter_modifier)
//Modifies the internal_fusion temperature with the amount of heat output
if(internal_fusion.temperature <= FUSION_MAXIMUM_TEMPERATURE)
internal_fusion.temperature = clamp(internal_fusion.temperature + heat_output,TCMB,FUSION_MAXIMUM_TEMPERATURE)
else
internal_fusion.temperature -= heat_limiter_modifier * 0.01 * delta_time
var/datum/gas_mixture/internal_output = new
//gas consumption and production
if(check_fuel())
@@ -1065,6 +1059,12 @@
moderator_internal.gases[/datum/gas/healium][MOLES] -= min(moderator_internal.gases[/datum/gas/healium][MOLES], scaled_production * 20)
internal_fusion.gases[/datum/gas/antinoblium][MOLES] += 0.01 * (scaled_helium / (fuel_injection_rate * 0.0095)) * delta_time
//Modifies the internal_fusion temperature with the amount of heat output
if(internal_fusion.temperature <= FUSION_MAXIMUM_TEMPERATURE)
internal_fusion.temperature = clamp(internal_fusion.temperature + heat_output,TCMB,FUSION_MAXIMUM_TEMPERATURE)
else
internal_fusion.temperature -= heat_limiter_modifier * 0.01 * delta_time
//heat up and output what's in the internal_output into the linked_output port
if(internal_output.total_moles() > 0)
if(moderator_internal.total_moles() > 0)