Fix PickUp verb showing up for entities in containers (#567)

This commit is contained in:
ShadowCommander
2020-01-26 05:00:59 -08:00
committed by Pieter-Jan Briers
parent 2ec493e2af
commit b71f39cfb4

View File

@@ -4,6 +4,7 @@ using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Items; using Content.Shared.GameObjects.Components.Items;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Server.Interfaces.GameObjects; using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Random; using Robust.Shared.Interfaces.Random;
@@ -84,7 +85,7 @@ namespace Content.Server.GameObjects
protected override VerbVisibility GetVisibility(IEntity user, ItemComponent component) protected override VerbVisibility GetVisibility(IEntity user, ItemComponent component)
{ {
if (user.TryGetComponent(out HandsComponent hands) && hands.IsHolding(component.Owner)) if (ContainerHelpers.IsInContainer(component.Owner))
{ {
return VerbVisibility.Invisible; return VerbVisibility.Invisible;
} }