Fix heat capacity scaling (#22464)
* Correctly apply HeatScale * Apply HeatScale on InitializeGases() * Re-add conservative heat scaling and speedup
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user