From cfda64361c4c0b89d9a87b40d683f920e8092821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= Date: Mon, 12 Oct 2020 13:37:41 +0200 Subject: [PATCH] You can now pick up items with an empty hand in combat mode. Closes #2206 --- .../EntitySystems/Click/InteractionSystem.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index e60b53d151..d290ec2d2f 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Threading.Tasks; using Content.Server.GameObjects.Components.GUI; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Movement; using Content.Server.GameObjects.Components.Timing; @@ -857,6 +858,18 @@ namespace Content.Server.GameObjects.EntitySystems.Click return; } } + else + { + // We pick up items if our hand is empty, even if we're in combat mode. + if(EntityManager.TryGetEntity(target, out var targetEnt)) + { + if (targetEnt.HasComponent()) + { + Interaction(player, targetEnt); + return; + } + } + } } foreach (var attackComponent in player.GetAllComponents())