(ca0e4bd45) When attempting to deconstruct an item that can't be deconstructed, put it in the output inventory instead of leaving it in the input

This commit is contained in:
Joonas Rikkonen
2019-04-25 17:48:45 +03:00
parent ae33907727
commit 9df0141640

View File

@@ -102,6 +102,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);