From: Cojoke <83733158+Cojoke-dot@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:53:44 +0000 (-0500) Subject: Remove Walking out of Containers while You can't Walk (#30391) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=247222beabacd3ad540b35c26c1101c0fdc7bd61;p=space-station-14.git Remove Walking out of Containers while You can't Walk (#30391) * Require Standing to Exit Containers * whoops, forgot a not * You can't walk out if cuffed * GUAH(requested stuff) * bwomp(tiny cleanup) --- diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index aa1ab3dacc..37a5ba2ef8 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -25,7 +25,6 @@ using Content.Shared.Interaction; using Content.Shared.Item; using Content.Shared.Movement.Events; using Content.Shared.Popups; -using Content.Shared.Throwing; using Content.Shared.Verbs; using Robust.Server.Audio; using Robust.Server.GameObjects; @@ -35,7 +34,6 @@ using Robust.Shared.Map.Components; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Events; using Robust.Shared.Player; -using Robust.Shared.Random; using Robust.Shared.Utility; namespace Content.Server.Disposal.Unit.EntitySystems; @@ -331,12 +329,13 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem { var currentTime = GameTiming.CurTime; + if (!_actionBlockerSystem.CanMove(args.Entity)) + return; + if (!TryComp(args.Entity, out HandsComponent? hands) || hands.Count == 0 || currentTime < component.LastExitAttempt + ExitAttemptDelay) - { return; - } component.LastExitAttempt = currentTime; Remove(uid, component, args.Entity); diff --git a/Content.Server/Resist/ResistLockerSystem.cs b/Content.Server/Resist/ResistLockerSystem.cs index 2ab277d0f1..8294ecc5f9 100644 --- a/Content.Server/Resist/ResistLockerSystem.cs +++ b/Content.Server/Resist/ResistLockerSystem.cs @@ -8,6 +8,7 @@ using Content.Shared.Popups; using Content.Shared.Resist; using Content.Shared.Tools.Components; using Content.Shared.Tools.Systems; +using Content.Shared.ActionBlocker; namespace Content.Server.Resist; @@ -18,6 +19,7 @@ public sealed class ResistLockerSystem : EntitySystem [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!; [Dependency] private readonly WeldableSystem _weldable = default!; + [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; public override void Initialize() { @@ -34,6 +36,9 @@ public sealed class ResistLockerSystem : EntitySystem if (!TryComp(uid, out EntityStorageComponent? storageComponent)) return; + if (!_actionBlocker.CanMove(args.Entity)) + return; + if (TryComp(uid, out var lockComponent) && lockComponent.Locked || _weldable.IsWelded(uid)) { AttemptResist(args.Entity, uid, storageComponent, component); diff --git a/Content.Shared/Burial/BurialSystem.cs b/Content.Shared/Burial/BurialSystem.cs index 45a89f3be9..5cf7d8820e 100644 --- a/Content.Shared/Burial/BurialSystem.cs +++ b/Content.Shared/Burial/BurialSystem.cs @@ -1,3 +1,4 @@ +using Content.Shared.ActionBlocker; using Content.Shared.Burial; using Content.Shared.Burial.Components; using Content.Shared.DoAfter; @@ -8,7 +9,6 @@ using Content.Shared.Popups; using Content.Shared.Storage.Components; using Content.Shared.Storage.EntitySystems; using Robust.Shared.Audio.Systems; -using Robust.Shared.Player; namespace Content.Server.Burial.Systems; @@ -18,6 +18,7 @@ public sealed class BurialSystem : EntitySystem [Dependency] private readonly SharedEntityStorageSystem _storageSystem = default!; [Dependency] private readonly SharedAudioSystem _audioSystem = default!; [Dependency] private readonly SharedPopupSystem _popupSystem = default!; + [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; public override void Initialize() { @@ -162,6 +163,9 @@ public sealed class BurialSystem : EntitySystem if (component.HandDiggingDoAfter != null) return; + if (!_actionBlocker.CanMove(args.Entity)) + return; + var doAfterEventArgs = new DoAfterArgs(EntityManager, args.Entity, component.DigDelay / component.DigOutByHandModifier, new GraveDiggingDoAfterEvent(), uid, target: uid) { NeedHand = false, diff --git a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs index bb49725e04..4932613d0e 100644 --- a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs @@ -16,16 +16,14 @@ using Content.Shared.Tools.Systems; using Content.Shared.Verbs; using Content.Shared.Wall; using Content.Shared.Whitelist; -using Robust.Shared.Audio; +using Content.Shared.ActionBlocker; using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Network; using Robust.Shared.Physics; -using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; -using Robust.Shared.Prototypes; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -47,6 +45,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem [Dependency] protected readonly SharedTransformSystem TransformSystem = default!; [Dependency] private readonly WeldableSystem _weldable = default!; [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!; + [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; public const string ContainerName = "entity_storage"; @@ -132,6 +131,9 @@ public abstract class SharedEntityStorageSystem : EntitySystem if (!HasComp(args.Entity)) return; + if (!_actionBlocker.CanMove(args.Entity)) + return; + if (_timing.CurTime < component.NextInternalOpenAttempt) return; @@ -139,9 +141,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem Dirty(uid, component); if (component.OpenOnMove) - { TryOpenStorage(args.Entity, uid); - } } protected void OnFoldAttempt(EntityUid uid, SharedEntityStorageComponent component, ref FoldAttemptEvent args)