[Hotfix] Remove pull-escape trick (#40368)
* make HandleStopPull byref * we get signal
This commit is contained in:
@@ -242,15 +242,20 @@ namespace Content.Shared.Cuffs
|
|||||||
args.Cancel();
|
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))
|
if (args.User == null || !Exists(args.User.Value))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (args.User.Value == uid && !component.CanStillInteract)
|
if (args.User.Value == uid && !component.CanStillInteract)
|
||||||
|
{
|
||||||
|
//TODO: UX feedback. Simply blocking the normal interaction feels like an interface bug
|
||||||
|
|
||||||
args.Cancelled = true;
|
args.Cancelled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void OnRemoveCuffsAlert(Entity<CuffableComponent> ent, ref RemoveCuffsAlertEvent args)
|
private void OnRemoveCuffsAlert(Entity<CuffableComponent> ent, ref RemoveCuffsAlertEvent args)
|
||||||
{
|
{
|
||||||
if (args.Handled)
|
if (args.Handled)
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ namespace Content.Shared.Pulling.Events;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Raised when a request is made to stop pulling an entity.
|
/// Raised when a request is made to stop pulling an entity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
|
[ByRefEvent]
|
||||||
public record struct AttemptStopPullingEvent(EntityUid? User = null)
|
public record struct AttemptStopPullingEvent(EntityUid? User = null)
|
||||||
{
|
{
|
||||||
public readonly EntityUid? User = User;
|
public readonly EntityUid? User = User;
|
||||||
|
|||||||
@@ -599,7 +599,7 @@ public sealed class PullingSystem : EntitySystem
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
var msg = new AttemptStopPullingEvent(user);
|
var msg = new AttemptStopPullingEvent(user);
|
||||||
RaiseLocalEvent(pullableUid, msg, true);
|
RaiseLocalEvent(pullableUid, ref msg, true);
|
||||||
|
|
||||||
if (msg.Cancelled)
|
if (msg.Cancelled)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user