tanks only produce noise with sufficient valve pressure (#22401)

This commit is contained in:
tgrkzus
2023-12-15 20:56:17 +11:00
committed by GitHub
parent 0a8a6693a8
commit bc925cb41c

View File

@@ -39,6 +39,7 @@ namespace Content.Server.Atmos.EntitySystems
private const float TimerDelay = 0.5f; private const float TimerDelay = 0.5f;
private float _timer = 0f; private float _timer = 0f;
private const float MinimumSoundValvePressure = 10.0f;
public override void Initialize() public override void Initialize()
{ {
@@ -178,7 +179,8 @@ namespace Content.Server.Atmos.EntitySystems
var strength = removed.TotalMoles * MathF.Sqrt(removed.Temperature); var strength = removed.TotalMoles * MathF.Sqrt(removed.Temperature);
var dir = _random.NextAngle().ToWorldVec(); var dir = _random.NextAngle().ToWorldVec();
_throwing.TryThrow(gasTank, dir * strength, strength); _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) private void ToggleInternals(Entity<GasTankComponent> ent)