]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
[Hotfix] Remove pull-escape trick (#40368)
authorErrant <35878406+Errant-4@users.noreply.github.com>
Mon, 15 Sep 2025 11:31:22 +0000 (13:31 +0200)
committerGitHub <noreply@github.com>
Mon, 15 Sep 2025 11:31:22 +0000 (13:31 +0200)
* make HandleStopPull byref

* we get signal

Content.Shared/Cuffs/SharedCuffableSystem.cs
Content.Shared/Movement/Pulling/Events/AttemptStopPullingEvent.cs
Content.Shared/Movement/Pulling/Systems/PullingSystem.cs

index 80ccc0619a94dcf61d54889a3a905e4214466d31..ff4201acaf0574eeb8508bc57b9bae536c61fd26 100644 (file)
@@ -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<CuffableComponent> ent, ref RemoveCuffsAlertEvent args)
index cd7edc5f623fe4f2bc737721e698547ba053aee7..a4d7f6c3ffafb33fd3a0f49a57cd001483e1b4b8 100644 (file)
@@ -3,8 +3,10 @@ namespace Content.Shared.Pulling.Events;
 /// <summary>
 /// Raised when a request is made to stop pulling an entity.
 /// </summary>
+
+[ByRefEvent]
 public record struct AttemptStopPullingEvent(EntityUid? User = null)
 {
     public readonly EntityUid? User = User;
     public bool Cancelled;
-}
\ No newline at end of file
+}
index 7fb9e825cd1ed440666bbe20506767d44fddf31c..3784dc0402a8f648df3e73572c89efe605838459 100644 (file)
@@ -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;