diff --git a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs index d05c6ca064..aee3c389b3 100644 --- a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs @@ -75,6 +75,18 @@ namespace Content.Server.GameObjects } } + public bool IsHolding(IEntity entity) + { + foreach (var slot in hands.Values) + { + if (slot.ContainedEntity == entity) + { + return true; + } + } + return false; + } + /// public void RemoveHandEntity(IEntity entity) { diff --git a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs index 843bc08bf1..f9e3bf69c6 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs @@ -38,17 +38,25 @@ namespace Content.Server.GameObjects { protected override string GetText(IEntity user, ItemComponent component) { + if (user.TryGetComponent(out HandsComponent hands) && hands.IsHolding(component.Owner)) + { + return "Pick Up (Already Holding)"; + } return "Pick Up"; } protected override bool IsDisabled(IEntity user, ItemComponent component) { + if (user.TryGetComponent(out HandsComponent hands) && hands.IsHolding(component.Owner)) + { + return true; + } return false; } protected override void Activate(IEntity user, ItemComponent component) { - if (user.TryGetComponent(out HandsComponent hands)) + if (user.TryGetComponent(out HandsComponent hands) && !hands.IsHolding(component.Owner)) { hands.PutInHand(component); }