Rat king tweaks (#9000)

This commit is contained in:
Kara
2022-06-21 07:00:11 -07:00
committed by GitHub
parent 849b794489
commit 8d18d733b8
5 changed files with 18 additions and 3 deletions

View File

@@ -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;
}