Skip to content

Commit

Permalink
Added another variable so that the critical blocks stayed steady each…
Browse files Browse the repository at this point in the history
… frame
  • Loading branch information
Gauge committed Dec 18, 2024
1 parent 90c9770 commit 6677036
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ThermalDynamics/Data/Scripts/Thermodynamics/ThermalCell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
5 changes: 4 additions & 1 deletion ThermalDynamics/Data/Scripts/Thermodynamics/ThermalGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public partial class ThermalGrid : MyGameLogicComponent
/// the number of blocks above the critical threshold
/// </summary>
public int CriticalBlocks = 0;
public int CurrentCriticalBlocks = 0;

public long SurfaceUpdateFrame = 0;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6677036

Please sign in to comment.