(24bcea40e) Fix the ai checks about door buttons. Don't aim at targets that cannot be seen.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:25:52 +03:00
parent bd4b3bd7f9
commit 812598774e
11 changed files with 268 additions and 176 deletions
@@ -867,6 +867,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);