Entities with hands still respect "needsHands: false" for Puller (#9266)
This commit is contained in:
@@ -54,7 +54,6 @@ namespace Content.Server.Hands.Systems
|
|||||||
|
|
||||||
SubscribeLocalEvent<HandsComponent, DisarmedEvent>(OnDisarmed, before: new[] { typeof(StunSystem) });
|
SubscribeLocalEvent<HandsComponent, DisarmedEvent>(OnDisarmed, before: new[] { typeof(StunSystem) });
|
||||||
|
|
||||||
SubscribeLocalEvent<HandsComponent, PullAttemptEvent>(HandlePullAttempt);
|
|
||||||
SubscribeLocalEvent<HandsComponent, PullStartedMessage>(HandlePullStarted);
|
SubscribeLocalEvent<HandsComponent, PullStartedMessage>(HandlePullStarted);
|
||||||
SubscribeLocalEvent<HandsComponent, PullStoppedMessage>(HandlePullStopped);
|
SubscribeLocalEvent<HandsComponent, PullStoppedMessage>(HandlePullStopped);
|
||||||
|
|
||||||
@@ -148,19 +147,12 @@ namespace Content.Server.Hands.Systems
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region pulling
|
#region pulling
|
||||||
private static void HandlePullAttempt(EntityUid uid, HandsComponent component, PullAttemptEvent args)
|
private void HandlePullStarted(EntityUid uid, HandsComponent component, PullStartedMessage args)
|
||||||
{
|
{
|
||||||
if (args.Puller.Owner != uid)
|
if (args.Puller.Owner != uid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Cancel pull if all hands full.
|
if (TryComp<SharedPullerComponent>(args.Puller.Owner, out var pullerComp) && !pullerComp.NeedsHands)
|
||||||
if (!component.IsAnyHandFree())
|
|
||||||
args.Cancelled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandlePullStarted(EntityUid uid, HandsComponent component, PullStartedMessage args)
|
|
||||||
{
|
|
||||||
if (args.Puller.Owner != uid)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!_virtualItemSystem.TrySpawnVirtualItemInHand(args.Pulled.Owner, uid))
|
if (!_virtualItemSystem.TrySpawnVirtualItemInHand(args.Pulled.Owner, uid))
|
||||||
|
|||||||
Reference in New Issue
Block a user