Can't break other people's drags on cuffed people (#8868)
* works on my machine * speedrun
This commit is contained in:
@@ -7,6 +7,7 @@ using Content.Shared.Item;
|
||||
using Content.Shared.Movement;
|
||||
using Content.Shared.Physics.Pull;
|
||||
using Content.Shared.Pulling.Components;
|
||||
using Content.Shared.Pulling.Events;
|
||||
|
||||
namespace Content.Shared.Cuffs
|
||||
{
|
||||
@@ -25,10 +26,20 @@ namespace Content.Shared.Cuffs
|
||||
SubscribeLocalEvent<SharedCuffableComponent, IsUnequippingAttemptEvent>(OnUnequipAttempt);
|
||||
SubscribeLocalEvent<SharedCuffableComponent, DropAttemptEvent>(OnDropAttempt);
|
||||
SubscribeLocalEvent<SharedCuffableComponent, PickupAttemptEvent>(OnPickupAttempt);
|
||||
SubscribeLocalEvent<SharedCuffableComponent, BeingPulledAttemptEvent>(OnBeingPulledAttempt);
|
||||
SubscribeLocalEvent<SharedCuffableComponent, PullStartedMessage>(OnPull);
|
||||
SubscribeLocalEvent<SharedCuffableComponent, PullStoppedMessage>(OnPull);
|
||||
}
|
||||
|
||||
|
||||
private void OnBeingPulledAttempt(EntityUid uid, SharedCuffableComponent component, BeingPulledAttemptEvent args)
|
||||
{
|
||||
if (!TryComp<SharedPullableComponent>(uid, out var pullable))
|
||||
return;
|
||||
|
||||
if (pullable.Puller != null && !component.CanStillInteract) // If we are being pulled already and cuffed, we can't get pulled again.
|
||||
args.Cancel();
|
||||
}
|
||||
private void OnPull(EntityUid uid, SharedCuffableComponent component, PullMessage args)
|
||||
{
|
||||
if (!component.CanStillInteract)
|
||||
|
||||
Reference in New Issue
Block a user