Check for divide by near zero (#22876)

This commit is contained in:
Kevin Zheng
2023-12-22 17:10:33 -08:00
committed by GitHub
parent e559c080ff
commit 99d6aff7be
2 changed files with 6 additions and 3 deletions

View File

@@ -113,7 +113,10 @@ public sealed class GenericGasReactionSystem : EntitySystem
}
float newHeatCapacity = _atmosphere.GetHeatCapacity(mix, true);
mix.Temperature = (initialE + reactionE)/newHeatCapacity;
if (newHeatCapacity > Atmospherics.MinimumHeatCapacity)
{
mix.Temperature = (initialE + reactionE)/newHeatCapacity;
}
if (reactionE > 0)
{
var location = holder as TileAtmosphere;