Rat king tweaks (#9000)
This commit is contained in:
@@ -12,6 +12,12 @@
|
||||
[ViewVariables]
|
||||
public EntityUid? Pulling { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Does this entity need hands to be able to pull something?
|
||||
/// </summary>
|
||||
[DataField("needsHands")]
|
||||
public bool NeedsHands = true;
|
||||
|
||||
protected override void Shutdown()
|
||||
{
|
||||
EntitySystem.Get<SharedPullingStateManagementSystem>().ForceDisconnectPuller(this);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Content.Shared.Pulling
|
||||
|
||||
private void AddPullVerbs(EntityUid uid, SharedPullableComponent component, GetVerbsEvent<Verb> args)
|
||||
{
|
||||
if (args.Hands == null || !args.CanAccess || !args.CanInteract)
|
||||
if (!args.CanAccess || !args.CanInteract)
|
||||
return;
|
||||
|
||||
// Are they trying to pull themselves up by their bootstraps?
|
||||
|
||||
Reference in New Issue
Block a user