]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix pressing shift while held triggering escape (#24878)
authorTayrtahn <tayrtahn@gmail.com>
Sat, 3 Feb 2024 02:14:20 +0000 (21:14 -0500)
committerGitHub <noreply@github.com>
Sat, 3 Feb 2024 02:14:20 +0000 (13:14 +1100)
* We meet again, my old friend.

* Helper property

Content.Server/Resist/EscapeInventorySystem.cs
Content.Shared/Movement/Events/MoveInputEvent.cs

index 56e0684aae80ba54248c693f2255b4959b16e2c5..8973540487fc1b987b09a9d2f54fd731b5c12880 100644 (file)
@@ -7,6 +7,7 @@ using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Inventory;
 using Content.Shared.Movement.Events;
+using Content.Shared.Movement.Systems;
 using Content.Shared.Resist;
 using Content.Shared.Storage;
 using Robust.Shared.Containers;
@@ -38,6 +39,9 @@ public sealed class EscapeInventorySystem : EntitySystem
 
     private void OnRelayMovement(EntityUid uid, CanEscapeInventoryComponent component, ref MoveInputEvent args)
     {
+        if (!args.HasDirectionalMovement)
+            return;
+
         if (!_containerSystem.TryGetContainingContainer(uid, out var container) || !_actionBlockerSystem.CanInteract(uid, container.Owner))
             return;
 
index 2d0f07e6c0237e0850e6fedfc6682294bb1d370e..1c677a42e87ac6f57119fd350b7a9ae82e9895a2 100644 (file)
@@ -13,6 +13,8 @@ public readonly struct MoveInputEvent
     public readonly InputMoverComponent Component;
     public readonly MoveButtons OldMovement;
 
+    public bool HasDirectionalMovement => (Component.HeldMoveButtons & MoveButtons.AnyDirection) != MoveButtons.None;
+
     public MoveInputEvent(EntityUid entity, InputMoverComponent component, MoveButtons oldMovement)
     {
         Entity = entity;