storage open sound has cooldown now (#14811)
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Server.Hands.Components;
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Timing;
|
||||
using Content.Shared.Verbs;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
@@ -59,6 +60,7 @@ namespace Content.Server.Storage.EntitySystems
|
||||
[Dependency] private readonly SharedCombatModeSystem _combatMode = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly UseDelaySystem _useDelay = default!;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Initialize()
|
||||
@@ -601,8 +603,14 @@ namespace Content.Server.Storage.EntitySystems
|
||||
if (!Resolve(uid, ref storageComp) || !TryComp(entity, out ActorComponent? player))
|
||||
return;
|
||||
|
||||
// prevent spamming bag open / honkerton honk sound
|
||||
silent |= TryComp<UseDelayComponent>(uid, out var useDelay) && _useDelay.ActiveDelay(uid, useDelay);
|
||||
if (!silent)
|
||||
{
|
||||
_audio.PlayPvs(storageComp.StorageOpenSound, uid);
|
||||
if (useDelay != null)
|
||||
_useDelay.BeginDelay(uid, useDelay);
|
||||
}
|
||||
|
||||
Logger.DebugS(storageComp.LoggerName, $"Storage (UID {uid}) \"used\" by player session (UID {player.PlayerSession.AttachedEntity}).");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user