Fix TritiumFireReaction low fuel limiting behavior (#42407)
fix fuel burn limiting logic incorrectly taking max instead of min
This commit is contained in:
parent
b1b7e884f8
commit
3f34d833fb
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in New Issue