hands ECS (#7081)
This commit is contained in:
@@ -216,7 +216,7 @@ namespace Content.Shared.Interaction
|
||||
|
||||
// Does the user have hands?
|
||||
Hand? hand;
|
||||
if (!TryComp(user, out SharedHandsComponent? hands) || !hands.TryGetActiveHand(out hand))
|
||||
if (!TryComp(user, out SharedHandsComponent? hands) || hands.ActiveHand == null)
|
||||
return;
|
||||
|
||||
var inRangeUnobstructed = target == null
|
||||
@@ -224,7 +224,7 @@ namespace Content.Shared.Interaction
|
||||
: !checkAccess || InRangeUnobstructed(user, target.Value); // permits interactions with wall mounted entities
|
||||
|
||||
// empty-hand interactions
|
||||
if (hand.HeldEntity == null)
|
||||
if (hands.ActiveHandEntity is not EntityUid held)
|
||||
{
|
||||
if (inRangeUnobstructed && target != null)
|
||||
InteractHand(user, target.Value);
|
||||
@@ -236,7 +236,7 @@ namespace Content.Shared.Interaction
|
||||
if (checkCanUse && !_actionBlockerSystem.CanUseHeldEntity(user))
|
||||
return;
|
||||
|
||||
if (target == hand.HeldEntity)
|
||||
if (target == held)
|
||||
{
|
||||
UseInHandInteraction(user, target.Value, checkCanUse: false, checkCanInteract: false);
|
||||
return;
|
||||
@@ -246,7 +246,7 @@ namespace Content.Shared.Interaction
|
||||
{
|
||||
InteractUsing(
|
||||
user,
|
||||
hand.HeldEntity.Value,
|
||||
held,
|
||||
target.Value,
|
||||
coordinates,
|
||||
checkCanInteract: false,
|
||||
@@ -257,7 +257,7 @@ namespace Content.Shared.Interaction
|
||||
|
||||
InteractUsingRanged(
|
||||
user,
|
||||
hand.HeldEntity.Value,
|
||||
held,
|
||||
target,
|
||||
coordinates,
|
||||
inRangeUnobstructed);
|
||||
|
||||
Reference in New Issue
Block a user