Limit air lost by wrenching/breaking pipes (#29574)

Gas lost via wrench/breaking capped
This commit is contained in:
osjarw
2024-06-29 19:06:25 +03:00
committed by GitHub
parent e8ee3bc1ad
commit 6af418663e

View File

@@ -82,7 +82,10 @@ namespace Content.Server.Atmos.Piping.EntitySystems
continue;
var difference = pipe.Air.Pressure - environment.Pressure;
lost += difference * environment.Volume / (environment.Temperature * Atmospherics.R);
lost += Math.Min(
pipe.Volume / pipe.Air.Volume * pipe.Air.TotalMoles,
difference * environment.Volume / (environment.Temperature * Atmospherics.R)
);
timesLost++;
}