Enable verbs for items in storage and prevent orphaned nested UIs (#5512)
This commit is contained in:
@@ -26,8 +26,10 @@ namespace Content.Shared.Item
|
||||
verb.Act = () => args.Hands.TryPutInActiveHandOrAny(args.Target);
|
||||
verb.IconTexture = "/Textures/Interface/VerbIcons/pickup.svg.192dpi.png";
|
||||
|
||||
// if the item already in the user's inventory, change the text
|
||||
if (args.Target.TryGetContainer(out var container) && container.Owner == args.User)
|
||||
// if the item already in a container (that is not the same as the user's), then change the text.
|
||||
// this occurs when the item is in their inventory or in an open backpack
|
||||
args.User.TryGetContainer(out var userContainer);
|
||||
if (args.Target.TryGetContainer(out var container) && container != userContainer)
|
||||
verb.Text = Loc.GetString("pick-up-verb-get-data-text-inventory");
|
||||
else
|
||||
verb.Text = Loc.GetString("pick-up-verb-get-data-text");
|
||||
|
||||
Reference in New Issue
Block a user