From 8e084eea28828587ff299c129a5338c4cfef98ef Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 1 Dec 2021 00:29:15 +1100 Subject: [PATCH] Only accumulate ambience cd when in a new tick (#5623) --- Content.Client/Audio/AmbientSoundSystem.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Content.Client/Audio/AmbientSoundSystem.cs b/Content.Client/Audio/AmbientSoundSystem.cs index ce6e781e3f..ac19253201 100644 --- a/Content.Client/Audio/AmbientSoundSystem.cs +++ b/Content.Client/Audio/AmbientSoundSystem.cs @@ -10,6 +10,7 @@ using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Player; using Robust.Shared.Random; +using Robust.Shared.Timing; namespace Content.Client.Audio { @@ -19,6 +20,7 @@ namespace Content.Client.Audio public sealed class AmbientSoundSystem : SharedAmbientSoundSystem { [Dependency] private IEntityLookup _lookup = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IRobustRandom _random = default!; @@ -75,6 +77,8 @@ namespace Content.Client.Audio { base.Update(frameTime); + if (!_gameTiming.IsFirstTimePredicted) return; + if (_cooldown <= 0f) { _accumulator = 0f;