]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remove Walking out of Containers while You can't Walk (#30391)
authorCojoke <83733158+Cojoke-dot@users.noreply.github.com>
Tue, 30 Jul 2024 13:53:44 +0000 (08:53 -0500)
committerGitHub <noreply@github.com>
Tue, 30 Jul 2024 13:53:44 +0000 (09:53 -0400)
* Require Standing to Exit Containers

* whoops, forgot a not

* You can't walk out if cuffed

* GUAH(requested stuff)

* bwomp(tiny cleanup)

Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs
Content.Server/Resist/ResistLockerSystem.cs
Content.Shared/Burial/BurialSystem.cs
Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs

index aa1ab3daccd9b2bcb560f114e75f07732757fb18..37a5ba2ef8e92c5118ae4ef7f075e911505b815a 100644 (file)
@@ -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);
index 2ab277d0f1a16fae4b446e21376ebd1e620afb28..8294ecc5f9d536af1edd297a8125247227c779dc 100644 (file)
@@ -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<LockComponent>(uid, out var lockComponent) && lockComponent.Locked || _weldable.IsWelded(uid))
         {
             AttemptResist(args.Entity, uid, storageComponent, component);
index 45a89f3be9704387d7cc34b2e034eb49dde115c5..5cf7d8820e9109676d91432299a52bf4f0e0b562 100644 (file)
@@ -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,
index bb49725e04711184a0f48a1303f7a8a3d0807043..4932613d0e640dad56b042a9a75f95f62dbea662 100644 (file)
@@ -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<HandsComponent>(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)