Emergency revert for pulling (#24923)
Revert "Pulling rework (#20906)"
This reverts commit 0d8254b2a2.
This commit is contained in:
@@ -22,8 +22,9 @@ using Content.Shared.Inventory.VirtualItem;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Content.Shared.Movement.Pulling.Events;
|
||||
using Content.Shared.Physics.Pull;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Pulling.Components;
|
||||
using Content.Shared.Pulling.Events;
|
||||
using Content.Shared.Rejuvenate;
|
||||
using Content.Shared.Stunnable;
|
||||
@@ -35,7 +36,6 @@ using Robust.Shared.Containers;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Serialization;
|
||||
using PullableComponent = Content.Shared.Movement.Pulling.Components.PullableComponent;
|
||||
|
||||
namespace Content.Shared.Cuffs
|
||||
{
|
||||
@@ -70,7 +70,7 @@ namespace Content.Shared.Cuffs
|
||||
SubscribeLocalEvent<CuffableComponent, EntInsertedIntoContainerMessage>(OnCuffsInsertedIntoContainer);
|
||||
SubscribeLocalEvent<CuffableComponent, RejuvenateEvent>(OnRejuvenate);
|
||||
SubscribeLocalEvent<CuffableComponent, ComponentInit>(OnStartup);
|
||||
SubscribeLocalEvent<CuffableComponent, AttemptStopPullingEvent>(HandleStopPull);
|
||||
SubscribeLocalEvent<CuffableComponent, StopPullingEvent>(HandleStopPull);
|
||||
SubscribeLocalEvent<CuffableComponent, UpdateCanMoveEvent>(HandleMoveAttempt);
|
||||
SubscribeLocalEvent<CuffableComponent, IsEquippingAttemptEvent>(OnEquipAttempt);
|
||||
SubscribeLocalEvent<CuffableComponent, IsUnequippingAttemptEvent>(OnUnequipAttempt);
|
||||
@@ -182,7 +182,7 @@ namespace Content.Shared.Cuffs
|
||||
|
||||
private void OnBeingPulledAttempt(EntityUid uid, CuffableComponent component, BeingPulledAttemptEvent args)
|
||||
{
|
||||
if (!TryComp<PullableComponent>(uid, out var pullable))
|
||||
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.
|
||||
@@ -214,19 +214,19 @@ namespace Content.Shared.Cuffs
|
||||
|
||||
private void HandleMoveAttempt(EntityUid uid, CuffableComponent component, UpdateCanMoveEvent args)
|
||||
{
|
||||
if (component.CanStillInteract || !EntityManager.TryGetComponent(uid, out PullableComponent? pullable) || !pullable.BeingPulled)
|
||||
if (component.CanStillInteract || !EntityManager.TryGetComponent(uid, out SharedPullableComponent? pullable) || !pullable.BeingPulled)
|
||||
return;
|
||||
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
private void HandleStopPull(EntityUid uid, CuffableComponent component, AttemptStopPullingEvent args)
|
||||
private void HandleStopPull(EntityUid uid, CuffableComponent component, StopPullingEvent args)
|
||||
{
|
||||
if (args.User == null || !Exists(args.User.Value))
|
||||
return;
|
||||
|
||||
if (args.User.Value == uid && !component.CanStillInteract)
|
||||
args.Cancelled = true;
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
private void AddUncuffVerb(EntityUid uid, CuffableComponent component, GetVerbsEvent<Verb> args)
|
||||
|
||||
Reference in New Issue
Block a user