From eecdc093bd02b4c4d18a5e513de2cd25de85dbb9 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 19 Jan 2021 11:36:24 +0100 Subject: [PATCH] [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 --- .../machinery/components/fusion/hypertorus.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/atmospherics/machinery/components/fusion/hypertorus.dm b/code/modules/atmospherics/machinery/components/fusion/hypertorus.dm index a593d2fef79..47e8c6e125e 100644 --- a/code/modules/atmospherics/machinery/components/fusion/hypertorus.dm +++ b/code/modules/atmospherics/machinery/components/fusion/hypertorus.dm @@ -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)