You can now pick up items with an empty hand in combat mode.

Closes #2206
This commit is contained in:
Víctor Aguilera Puerto
2020-10-12 13:37:41 +02:00
parent 8e8744b383
commit cfda64361c

View File

@@ -2,6 +2,7 @@
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Content.Server.GameObjects.Components.GUI; using Content.Server.GameObjects.Components.GUI;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Movement; using Content.Server.GameObjects.Components.Movement;
using Content.Server.GameObjects.Components.Timing; using Content.Server.GameObjects.Components.Timing;
@@ -857,6 +858,18 @@ namespace Content.Server.GameObjects.EntitySystems.Click
return; 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<ItemComponent>())
{
Interaction(player, targetEnt);
return;
}
}
}
} }
foreach (var attackComponent in player.GetAllComponents<IAttack>()) foreach (var attackComponent in player.GetAllComponents<IAttack>())