(fb180d412) Merge branch 'dev' into human-ai

This commit is contained in:
Joonas Rikkonen
2019-05-16 06:17:45 +03:00
parent 2f0bd98f8f
commit 8b977ed5c0
23 changed files with 425 additions and 150 deletions
@@ -271,10 +271,13 @@ namespace Barotrauma
{
bool isEquipped = !equip || character.HasEquippedItem(item);
if (character.Inventory.Items.Contains(item) && isEquipped) { return true; }
Item rootContainer = item.GetRootContainer();
if (rootContainer != null && rootContainer.ParentInventory is CharacterInventory)
if (!equip)
{
return rootContainer.ParentInventory.Owner == character;
Item rootContainer = item.GetRootContainer();
if (rootContainer != null && rootContainer.ParentInventory is CharacterInventory)
{
return rootContainer.ParentInventory.Owner == character;
}
}
return false;
}