From: Tayrtahn Date: Sat, 3 Feb 2024 02:14:20 +0000 (-0500) Subject: Fix pressing shift while held triggering escape (#24878) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=31207006f50d342d2d29c366977ebf4f783a68ea;p=space-station-14.git Fix pressing shift while held triggering escape (#24878) * We meet again, my old friend. * Helper property --- diff --git a/Content.Server/Resist/EscapeInventorySystem.cs b/Content.Server/Resist/EscapeInventorySystem.cs index 56e0684aae..8973540487 100644 --- a/Content.Server/Resist/EscapeInventorySystem.cs +++ b/Content.Server/Resist/EscapeInventorySystem.cs @@ -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; diff --git a/Content.Shared/Movement/Events/MoveInputEvent.cs b/Content.Shared/Movement/Events/MoveInputEvent.cs index 2d0f07e6c0..1c677a42e8 100644 --- a/Content.Shared/Movement/Events/MoveInputEvent.cs +++ b/Content.Shared/Movement/Events/MoveInputEvent.cs @@ -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;