]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
tanks only produce noise with sufficient valve pressure (#22401)
authortgrkzus <tgrkzus@gmail.com>
Fri, 15 Dec 2023 09:56:17 +0000 (20:56 +1100)
committerGitHub <noreply@github.com>
Fri, 15 Dec 2023 09:56:17 +0000 (02:56 -0700)
Content.Server/Atmos/EntitySystems/GasTankSystem.cs

index b476b906a9384a356d7d5d86b00739d5fbc61252..bdd60d6d05289e65e6eb76cb2393a487a5b58615 100644 (file)
@@ -39,6 +39,7 @@ namespace Content.Server.Atmos.EntitySystems
 
         private const float TimerDelay = 0.5f;
         private float _timer = 0f;
+        private const float MinimumSoundValvePressure = 10.0f;
 
         public override void Initialize()
         {
@@ -178,7 +179,8 @@ namespace Content.Server.Atmos.EntitySystems
             var strength = removed.TotalMoles * MathF.Sqrt(removed.Temperature);
             var dir = _random.NextAngle().ToWorldVec();
             _throwing.TryThrow(gasTank, dir * strength, strength);
-            _audioSys.PlayPvs(gasTank.Comp.RuptureSound, gasTank);
+            if (gasTank.Comp.OutputPressure >= MinimumSoundValvePressure)
+                _audioSys.PlayPvs(gasTank.Comp.RuptureSound, gasTank);
         }
 
         private void ToggleInternals(Entity<GasTankComponent> ent)