mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
[Hotfix] Remove pull-escape trick (#40368)
* make HandleStopPull byref * we get signal
This commit is contained in:
parent
d8e818283c
commit
9b5f9c3fd6
3 changed files with 10 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue