]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Limit air lost by wrenching/breaking pipes (#29574)
authorosjarw <62134478+osjarw@users.noreply.github.com>
Sat, 29 Jun 2024 16:06:25 +0000 (19:06 +0300)
committerGitHub <noreply@github.com>
Sat, 29 Jun 2024 16:06:25 +0000 (09:06 -0700)
Gas lost via wrench/breaking capped

Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs

index fcb3ccde682fb96c3ffc8ecaa8cf9a86c791e1d7..f594866fa23fec9854bd012bfb8f383fd89313d8 100644 (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++;
             }