This commit is contained in:
Leon Friedrich
2022-03-17 20:13:31 +13:00
committed by GitHub
parent 7b84362901
commit bfd95c493b
94 changed files with 1454 additions and 2185 deletions

View File

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