From 6af418663eb180756c33027b46f412bbadec5c68 Mon Sep 17 00:00:00 2001 From: osjarw <62134478+osjarw@users.noreply.github.com> Date: Sat, 29 Jun 2024 19:06:25 +0300 Subject: [PATCH] Limit air lost by wrenching/breaking pipes (#29574) Gas lost via wrench/breaking capped --- .../Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs b/Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs index fcb3ccde68..f594866fa2 100644 --- a/Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs +++ b/Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs @@ -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++; } -- 2.51.2