(4d56b6900) Fixed ability to drop items into secure lockers (or other containers that require specific items) without having access to it. Closes #1559
This commit is contained in:
@@ -442,7 +442,8 @@ namespace Barotrauma
|
|||||||
if (draggingItemToWorld)
|
if (draggingItemToWorld)
|
||||||
{
|
{
|
||||||
if (item.OwnInventory == null ||
|
if (item.OwnInventory == null ||
|
||||||
!item.OwnInventory.CanBePut(CharacterInventory.draggingItem))
|
!item.OwnInventory.CanBePut(CharacterInventory.draggingItem) ||
|
||||||
|
!CanAccessInventory(item.OwnInventory))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1519,10 +1519,9 @@ namespace Barotrauma
|
|||||||
if (inventory.Owner is Item)
|
if (inventory.Owner is Item)
|
||||||
{
|
{
|
||||||
var owner = (Item)inventory.Owner;
|
var owner = (Item)inventory.Owner;
|
||||||
if (!CanInteractWith(owner))
|
if (!CanInteractWith(owner)) { return false; }
|
||||||
{
|
ItemContainer container = owner.GetComponents<ItemContainer>().FirstOrDefault(ic => ic.Inventory == inventory);
|
||||||
return false;
|
if (container != null && !container.HasRequiredItems(this, addMessage: false)) { return false; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user