mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Only accumulate ambience cd when in a new tick (#5623)
This commit is contained in:
parent
e3b057973d
commit
8e084eea28
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue