From e8025a6e17869c33a5350ca246151a68408f98de Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Fri, 25 Mar 2022 22:10:50 +0100 Subject: [PATCH] Make InteractionActivate check for hands like UserInteraction (#7277) --- .../Interaction/SharedInteractionSystem.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 601785f893..42053b557f 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -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(user)) + return false; + var activateMsg = new ActivateInWorldEvent(user, used); RaiseLocalEvent(used, activateMsg); if (activateMsg.Handled) @@ -744,7 +747,7 @@ namespace Content.Shared.Interaction _adminLogSystem.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user):user} activated {ToPrettyString(used):used}"); return true; } - + var activatable = AllComps(used).FirstOrDefault(); if (activatable == null) return false;