Rat king tweaks (#9000)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Buckle.Components;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Physics.Pull;
|
||||
using Content.Shared.Pulling.Components;
|
||||
using Content.Shared.Pulling.Events;
|
||||
@@ -13,10 +14,16 @@ namespace Content.Shared.Pulling
|
||||
{
|
||||
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
|
||||
public bool CanPull(EntityUid puller, EntityUid pulled)
|
||||
{
|
||||
if (!EntityManager.HasComponent<SharedPullerComponent>(puller))
|
||||
if (!EntityManager.TryGetComponent<SharedPullerComponent>(puller, out var comp))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (comp.NeedsHands && !_handsSystem.TryGetEmptyHand(puller, out _))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user