From 9b5f9c3fd6aa400f47e9875cd7ba1f3ebb40e1fd Mon Sep 17 00:00:00 2001 From: Errant <35878406+Errant-4@users.noreply.github.com> Date: Mon, 15 Sep 2025 13:31:22 +0200 Subject: [PATCH] [Hotfix] Remove pull-escape trick (#40368) * make HandleStopPull byref * we get signal --- Content.Shared/Cuffs/SharedCuffableSystem.cs | 7 ++++++- .../Movement/Pulling/Events/AttemptStopPullingEvent.cs | 4 +++- Content.Shared/Movement/Pulling/Systems/PullingSystem.cs | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Cuffs/SharedCuffableSystem.cs b/Content.Shared/Cuffs/SharedCuffableSystem.cs index 80ccc0619a..ff4201acaf 100644 --- a/Content.Shared/Cuffs/SharedCuffableSystem.cs +++ b/Content.Shared/Cuffs/SharedCuffableSystem.cs @@ -242,13 +242,18 @@ namespace Content.Shared.Cuffs args.Cancel(); } - private void HandleStopPull(EntityUid uid, CuffableComponent component, AttemptStopPullingEvent args) + private void HandleStopPull(EntityUid uid, CuffableComponent component, ref AttemptStopPullingEvent args) { if (args.User == null || !Exists(args.User.Value)) return; if (args.User.Value == uid && !component.CanStillInteract) + { + //TODO: UX feedback. Simply blocking the normal interaction feels like an interface bug + args.Cancelled = true; + } + } private void OnRemoveCuffsAlert(Entity ent, ref RemoveCuffsAlertEvent args) diff --git a/Content.Shared/Movement/Pulling/Events/AttemptStopPullingEvent.cs b/Content.Shared/Movement/Pulling/Events/AttemptStopPullingEvent.cs index cd7edc5f62..a4d7f6c3ff 100644 --- a/Content.Shared/Movement/Pulling/Events/AttemptStopPullingEvent.cs +++ b/Content.Shared/Movement/Pulling/Events/AttemptStopPullingEvent.cs @@ -3,8 +3,10 @@ namespace Content.Shared.Pulling.Events; /// /// Raised when a request is made to stop pulling an entity. /// + +[ByRefEvent] public record struct AttemptStopPullingEvent(EntityUid? User = null) { public readonly EntityUid? User = User; public bool Cancelled; -} \ No newline at end of file +} diff --git a/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs b/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs index 7fb9e825cd..3784dc0402 100644 --- a/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs +++ b/Content.Shared/Movement/Pulling/Systems/PullingSystem.cs @@ -599,7 +599,7 @@ public sealed class PullingSystem : EntitySystem return true; var msg = new AttemptStopPullingEvent(user); - RaiseLocalEvent(pullableUid, msg, true); + RaiseLocalEvent(pullableUid, ref msg, true); if (msg.Cancelled) return false;