From: Kevin Zheng Date: Thu, 30 May 2024 00:34:41 +0000 (-0800) Subject: Fix flow rate display (#28372) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=241b8d8be5d3dc0391121ae22f0c21d25f297b35;p=space-station-14.git Fix flow rate display (#28372) --- diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPassiveGateSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPassiveGateSystem.cs index fced4d7988..008d3cb4ce 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPassiveGateSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPassiveGateSystem.cs @@ -39,7 +39,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems var T2 = outlet.Air.Temperature; var pressureDelta = P1 - P2; - float dt = 1/_atmosphereSystem.AtmosTickRate; + float dt = args.dt; float dV = 0; var denom = (T1*V2 + T2*V1); @@ -63,7 +63,9 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems var transferMoles = n1 - (n1+n2)*T2*V1 / denom; // Get the volume transfered to update our flow meter. - dV = n1*Atmospherics.R*T1/P1; + // When you remove x from one side and add x to the other the total difference is 2x. + // Also account for atmos speedup so that measured flow rate matches the setting on the volume pump. + dV = 2*transferMoles*Atmospherics.R*T1/P1 / _atmosphereSystem.Speedup; // Actually transfer the gas. _atmosphereSystem.Merge(outlet.Air, inlet.Air.Remove(transferMoles));