]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix flow rate display (#28372)
authorKevin Zheng <kevinz5000@gmail.com>
Thu, 30 May 2024 00:34:41 +0000 (16:34 -0800)
committerGitHub <noreply@github.com>
Thu, 30 May 2024 00:34:41 +0000 (20:34 -0400)
Content.Server/Atmos/Piping/Binary/EntitySystems/GasPassiveGateSystem.cs

index fced4d79884a4f6fe324b9a4c43bf79a33b18fc7..008d3cb4ce6168d0611fa286d33ae12ca8471777 100644 (file)
@@ -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));