diff --git a/Content.Shared/Burial/BurialSystem.cs b/Content.Shared/Burial/BurialSystem.cs index e19ac2e9c6..ccf5f1a298 100644 --- a/Content.Shared/Burial/BurialSystem.cs +++ b/Content.Shared/Burial/BurialSystem.cs @@ -51,8 +51,15 @@ public sealed class BurialSystem : EntitySystem BreakOnHandChange = true }; + if (component.Stream == null) + component.Stream = _audioSystem.PlayPredicted(component.DigSound, uid, args.User)?.Entity; + if (!_doAfterSystem.TryStartDoAfter(doAfterEventArgs)) + { + _audioSystem.Stop(component.Stream); return; + } + StartDigging(uid, args.User, args.Used, component); } @@ -111,8 +118,6 @@ public sealed class BurialSystem : EntitySystem { _popupSystem.PopupClient(Loc.GetString("grave-start-digging-user", ("grave", uid), ("tool", used)), user, user); _popupSystem.PopupEntity(Loc.GetString("grave-start-digging-others", ("user", user), ("grave", uid), ("tool", used)), user, Filter.PvsExcept(user), true); - if (component.Stream == null) - component.Stream = _audioSystem.PlayPredicted(component.DigSound, uid, user)?.Entity; component.ActiveShovelDigging = true; Dirty(uid, component); } @@ -163,8 +168,15 @@ public sealed class BurialSystem : EntitySystem BreakOnDamage = false }; - if (!_doAfterSystem.TryStartDoAfter(doAfterEventArgs, out component.HandDiggingDoAfter)) + + if (component.Stream == null) + component.Stream = _audioSystem.PlayPredicted(component.DigSound, uid, args.Entity)?.Entity; + + if (!_doAfterSystem.TryStartDoAfter(doAfterEventArgs)) + { + _audioSystem.Stop(component.Stream); return; + } StartDigging(uid, args.Entity, null, component); }