]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix heat capacity scaling (#22464)
authorKevin Zheng <kevinz5000@gmail.com>
Thu, 14 Dec 2023 02:38:58 +0000 (18:38 -0800)
committerGitHub <noreply@github.com>
Thu, 14 Dec 2023 02:38:58 +0000 (21:38 -0500)
* Correctly apply HeatScale

* Apply HeatScale on InitializeGases()

* Re-add conservative heat scaling and speedup

Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs
Content.Shared/CCVar/CCVars.cs

index bcd628a60de348a8c19782494f630339e09364c6..7f82e6fb57b9bfae64af331350fce03ec3230265 100644 (file)
@@ -52,7 +52,7 @@ namespace Content.Server.Atmos.EntitySystems
             _cfg.OnValueChanged(CCVars.AtmosMaxProcessTime, value => AtmosMaxProcessTime = value, true);
             _cfg.OnValueChanged(CCVars.AtmosTickRate, value => AtmosTickRate = value, true);
             _cfg.OnValueChanged(CCVars.AtmosSpeedup, value => Speedup = value, true);
-            _cfg.OnValueChanged(CCVars.AtmosHeatScale, value => HeatScale = value, true);
+            _cfg.OnValueChanged(CCVars.AtmosHeatScale, value => { HeatScale = value; InitializeGases(); }, true);
             _cfg.OnValueChanged(CCVars.ExcitedGroups, value => ExcitedGroups = value, true);
             _cfg.OnValueChanged(CCVars.ExcitedGroupsSpaceIsAllConsuming, value => ExcitedGroupsSpaceIsAllConsuming = value, true);
         }
index 41470c170c24b2b411c65cfbb2080f465cbc63f7..6a631858113bdcb8f87b8f0d4e3d9baecba0d998 100644 (file)
@@ -35,7 +35,7 @@ namespace Content.Server.Atmos.EntitySystems
 
             for (var i = 0; i < GasPrototypes.Length; i++)
             {
-                _gasSpecificHeats[i] = GasPrototypes[i].SpecificHeat;
+                _gasSpecificHeats[i] = GasPrototypes[i].SpecificHeat / HeatScale;
                 GasReagents[i] = GasPrototypes[i].Reagent;
             }
         }
@@ -61,7 +61,7 @@ namespace Content.Server.Atmos.EntitySystems
             NumericsHelpers.Multiply(moles, GasSpecificHeats, tmp);
             // Adjust heat capacity by speedup, because this is primarily what
             // determines how quickly gases heat up/cool.
-            return MathF.Max(NumericsHelpers.HorizontalAdd(tmp), Atmospherics.MinimumHeatCapacity) / HeatScale;
+            return MathF.Max(NumericsHelpers.HorizontalAdd(tmp), Atmospherics.MinimumHeatCapacity);
         }
 
         /// <summary>
index 087e7bb8503f42eafb82ba8e3e916d5aaf81145c..a8b2960728e0bb0eb81813e0838884facd7540d6 100644 (file)
@@ -1053,14 +1053,14 @@ namespace Content.Shared.CCVar
         ///     in-game.
         /// </summary>
         public static readonly CVarDef<float> AtmosSpeedup =
-            CVarDef.Create("atmos.speedup", 1f, CVar.SERVERONLY);
+            CVarDef.Create("atmos.speedup", 8f, CVar.SERVERONLY);
 
         /// <summary>
         ///     Like atmos.speedup, but only for gas and reaction heat values. 64x means
         ///     gases heat up and cool down 64x faster than real life.
         /// </summary>
         public static readonly CVarDef<float> AtmosHeatScale =
-            CVarDef.Create("atmos.heat_scale", 1f, CVar.SERVERONLY);
+            CVarDef.Create("atmos.heat_scale", 8f, CVar.SERVERONLY);
 
         /*
          * MIDI instruments