Allow pulling entities with full hands. (#5758)
This commit is contained in:
@@ -65,6 +65,9 @@ namespace Content.Server.Hands.Systems
|
||||
|
||||
private static void HandlePullAttempt(EntityUid uid, HandsComponent component, PullAttemptMessage args)
|
||||
{
|
||||
if (args.Puller.Owner != uid)
|
||||
return;
|
||||
|
||||
// Cancel pull if all hands full.
|
||||
if (component.Hands.All(hand => !hand.IsEmpty))
|
||||
args.Cancelled = true;
|
||||
@@ -72,6 +75,9 @@ namespace Content.Server.Hands.Systems
|
||||
|
||||
private void HandlePullStarted(EntityUid uid, HandsComponent component, PullStartedMessage args)
|
||||
{
|
||||
if (args.Puller.Owner != uid)
|
||||
return;
|
||||
|
||||
if (!_virtualItemSystem.TrySpawnVirtualItemInHand(args.Pulled.Owner, uid))
|
||||
{
|
||||
DebugTools.Assert("Unable to find available hand when starting pulling??");
|
||||
@@ -80,6 +86,9 @@ namespace Content.Server.Hands.Systems
|
||||
|
||||
private void HandlePullStopped(EntityUid uid, HandsComponent component, PullStoppedMessage args)
|
||||
{
|
||||
if (args.Puller.Owner != uid)
|
||||
return;
|
||||
|
||||
// Try find hand that is doing this pull.
|
||||
// and clear it.
|
||||
foreach (var hand in component.Hands)
|
||||
|
||||
Reference in New Issue
Block a user