diff --git a/Content.Shared/DeltaV/Salvage/Systems/MiningVoucherSystem.cs b/Content.Shared/DeltaV/Salvage/Systems/MiningVoucherSystem.cs index b5d5a00472d..30b44eef493 100644 --- a/Content.Shared/DeltaV/Salvage/Systems/MiningVoucherSystem.cs +++ b/Content.Shared/DeltaV/Salvage/Systems/MiningVoucherSystem.cs @@ -4,13 +4,17 @@ using Content.Shared.Power.EntitySystems; using Content.Shared.Whitelist; using Robust.Shared.Audio.Systems; +using Robust.Shared.Network; using Robust.Shared.Prototypes; +using Robust.Shared.Timing; namespace Content.Shared.DeltaV.Salvage.Systems; public sealed class MiningVoucherSystem : EntitySystem { [Dependency] private readonly EntityWhitelistSystem _whitelist = default!; + [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly INetManager _net = default!; [Dependency] private readonly IPrototypeManager _proto = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; @@ -50,7 +54,10 @@ private void OnAfterInteract(Entity ent, ref AfterIntera return; } - _audio.PlayPvs(ent.Comp.RedeemSound, target); + if (!_timing.IsFirstTimePredicted) + return; + + _audio.PlayPredicted(ent.Comp.RedeemSound, target, user); Redeem(ent, index, user); } @@ -71,6 +78,9 @@ private void OnSelect(Entity ent, ref MiningVoucherSelec public void Redeem(Entity ent, int index, EntityUid user) { + if (_net.IsClient) + return; + var kit = _proto.Index(ent.Comp.Kits[index]); var xform = Transform(ent); foreach (var id in kit.Content)