Make InteractionActivate check for hands like UserInteraction (#7277)

This commit is contained in:
DrSmugleaf
2022-03-25 22:10:50 +01:00
committed by GitHub
parent e563b0b7e1
commit e8025a6e17

View File

@@ -7,24 +7,24 @@ using Content.Shared.Database;
using Content.Shared.Hands.Components;
using Content.Shared.Input;
using Content.Shared.Interaction.Components;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Content.Shared.Physics;
using Content.Shared.Popups;
using Content.Shared.Throwing;
using Content.Shared.Timing;
using Content.Shared.Verbs;
using Content.Shared.Wall;
using JetBrains.Annotations;
using Robust.Shared.Containers;
using Robust.Shared.Input;
using Robust.Shared.Input.Binding;
using Robust.Shared.Map;
using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Content.Shared.Wall;
using Content.Shared.Item;
using Robust.Shared.Player;
using Robust.Shared.Input;
using Robust.Shared.Timing;
using Content.Shared.Interaction.Events;
#pragma warning disable 618
@@ -215,7 +215,6 @@ namespace Content.Shared.Interaction
return;
// Does the user have hands?
Hand? hand;
if (!TryComp(user, out SharedHandsComponent? hands) || hands.ActiveHand == null)
return;
@@ -736,6 +735,10 @@ namespace Content.Shared.Interaction
if (checkAccess && !ContainerSystem.IsInSameOrParentContainer(user, used) && !CanAccessViaStorage(user, used))
return false;
// Does the user have hands?
if (!HasComp<SharedHandsComponent>(user))
return false;
var activateMsg = new ActivateInWorldEvent(user, used);
RaiseLocalEvent(used, activateMsg);
if (activateMsg.Handled)