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 GitHub
parent 2399b61ca7
commit 6cae5d9c4a

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));