(913cde46d) Refactor AIObjectiveUsing to use the TryAddSubObjective method. Reorganize a bit.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:50:04 +03:00
parent 5d7cc6599c
commit 566f1d16e4
12 changed files with 473 additions and 166 deletions
@@ -905,6 +905,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);