+using Content.Shared.Clothing.Components;
using Content.Shared.Database;
using Content.Shared.Hands.Components;
using Content.Shared.Item;
if (checkActionBlocker && !_actionBlocker.CanPickup(uid, entity))
return false;
+ if (ContainerSystem.TryGetContainingContainer((entity, null, null), out var container))
+ {
+ if (!ContainerSystem.CanRemove(entity, container))
+ return false;
+
+ if (_inventory.TryGetSlotEntity(uid, container.ID, out var slotEnt) &&
+ slotEnt == entity &&
+ !_inventory.CanUnequip(uid, entity, container.ID, out _))
+ return false;
+ }
+
// check can insert (including raising attempt events).
return ContainerSystem.CanInsert(entity, handContainer);
}
using Content.Shared.Administration.Logs;
using Content.Shared.Hands.Components;
using Content.Shared.Interaction;
+using Content.Shared.Inventory;
using Content.Shared.Inventory.VirtualItem;
using Content.Shared.Storage.EntitySystems;
using Robust.Shared.Containers;
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
[Dependency] protected readonly SharedContainerSystem ContainerSystem = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
+ [Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly SharedStorageSystem _storage = default!;
[Dependency] protected readonly SharedTransformSystem TransformSystem = default!;
[Dependency] private readonly SharedVirtualItemSystem _virtualSystem = default!;