diff --git a/ThermalDynamics/Data/Scripts/Thermodynamics/ThermalCell.cs b/ThermalDynamics/Data/Scripts/Thermodynamics/ThermalCell.cs index 7297b0d..6533e63 100644 --- a/ThermalDynamics/Data/Scripts/Thermodynamics/ThermalCell.cs +++ b/ThermalDynamics/Data/Scripts/Thermodynamics/ThermalCell.cs @@ -484,7 +484,7 @@ private void HandleCriticalTemperature() { if (Settings.Instance.EnableDamage && Temperature > Definition.CriticalTemperature) { - Grid.CriticalBlocks++; + Grid.CurrentCriticalBlocks++; Block.DoDamage((Temperature - Definition.CriticalTemperature) * Definition.CriticalTemperatureScaler, MyStringHash.GetOrCompute("thermal"), false); } } diff --git a/ThermalDynamics/Data/Scripts/Thermodynamics/ThermalGrid.cs b/ThermalDynamics/Data/Scripts/Thermodynamics/ThermalGrid.cs index 559646c..679144a 100644 --- a/ThermalDynamics/Data/Scripts/Thermodynamics/ThermalGrid.cs +++ b/ThermalDynamics/Data/Scripts/Thermodynamics/ThermalGrid.cs @@ -70,6 +70,7 @@ public partial class ThermalGrid : MyGameLogicComponent /// the number of blocks above the critical threshold /// public int CriticalBlocks = 0; + public int CurrentCriticalBlocks = 0; public long SurfaceUpdateFrame = 0; @@ -457,7 +458,9 @@ public override void UpdateBeforeSimulation() private void PrepareNextSimulationStep() { - CriticalBlocks = 0; + CriticalBlocks = CurrentCriticalBlocks; + CurrentCriticalBlocks = 0; + Vector3D position = Grid.PositionComp.WorldAABB.Center; PrepareSolarEnvironment(ref position); PrepareEnvironmentTemprature(ref position);