Fix TritiumFireReaction low fuel limiting behavior (#42407)

fix fuel burn limiting logic incorrectly taking max instead of min
This commit is contained in:
ArtisticRoomba 2026-01-13 21:08:25 -08:00 committed by BarryNorfolk
parent b1b7e884f8
commit 3f34d833fb
1 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,8 @@ namespace Content.Server.Atmos.Reactions
}
else
{
burnedFuel = Math.Max(initialTrit, mixture.GetMoles(Gas.Oxygen) / Atmospherics.TritiumBurnFuelRatio) / Atmospherics.TritiumBurnTritFactor;
// Limit the amount of fuel burned by the limiting reactant, either our initial tritium or the amount of oxygen available given the burn ratio.
burnedFuel = Math.Min(initialTrit, mixture.GetMoles(Gas.Oxygen) / Atmospherics.TritiumBurnFuelRatio) / Atmospherics.TritiumBurnTritFactor;
mixture.AdjustMoles(Gas.Tritium, -burnedFuel);
mixture.AdjustMoles(Gas.Oxygen, -burnedFuel / Atmospherics.TritiumBurnFuelRatio);
energyReleased += (Atmospherics.FireHydrogenEnergyReleased * burnedFuel * (Atmospherics.TritiumBurnTritFactor - 1));