(3f4e69c0d) Only unequip items when idling. Fixes bots not being able to repair, because the tools were unequipped (if they were weapons).

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:34:03 +03:00
parent 155cb83f91
commit f667ed8e12
10 changed files with 201 additions and 248 deletions
@@ -886,6 +886,25 @@ namespace Barotrauma.Items.Components
}
}
if (targetItem.Prefab.DeconstructItems.Any())
{
inputContainer.Inventory.RemoveItem(targetItem);
Entity.Spawner.AddToRemoveQueue(targetItem);
MoveInputQueue();
PutItemsToLinkedContainer();
}
else
{
if (outputContainer.Inventory.Items.All(i => i != null))
{
targetItem.Drop(dropper: null);
}
else
{
outputContainer.Inventory.TryPutItem(targetItem, user: null, createNetworkEvent: true);
}
}
if (targetItem.Prefab.DeconstructItems.Any())
{
inputContainer.Inventory.RemoveItem(targetItem);