Revert "Remove IContainer and move functions to the container system.… (#19975)
This commit is contained in:
@@ -360,7 +360,7 @@ public abstract partial class InventorySystem
|
||||
}
|
||||
|
||||
//we need to do this to make sure we are 100% removing this entity, since we are now dropping dependant slots
|
||||
if (!force && !_containerSystem.CanRemove(removedItem.Value, slotContainer))
|
||||
if (!force && !slotContainer.CanRemove(removedItem.Value))
|
||||
return false;
|
||||
|
||||
foreach (var slotDef in GetSlots(target, inventory))
|
||||
@@ -426,12 +426,14 @@ public abstract partial class InventorySystem
|
||||
if ((containerSlot == null || slotDefinition == null) && !TryGetSlotContainer(target, slot, out containerSlot, out slotDefinition, inventory))
|
||||
return false;
|
||||
|
||||
if (containerSlot.ContainedEntity is not {} itemUid)
|
||||
if (containerSlot.ContainedEntity == null)
|
||||
return false;
|
||||
|
||||
if (!_containerSystem.CanRemove(itemUid, containerSlot))
|
||||
if (!containerSlot.ContainedEntity.HasValue || !containerSlot.CanRemove(containerSlot.ContainedEntity.Value))
|
||||
return false;
|
||||
|
||||
var itemUid = containerSlot.ContainedEntity.Value;
|
||||
|
||||
// make sure the user can actually reach the target
|
||||
if (!CanAccess(actor, target, itemUid))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user