NPCs don't try to use depth charge tubes when given the "operate railgun" command

This commit is contained in:
Regalis
2016-08-16 17:37:08 +03:00
parent cce3b32a82
commit 8a2ad8eb64
4 changed files with 25 additions and 6 deletions
@@ -63,6 +63,12 @@ namespace Barotrauma
if (equip)
{
var pickable = targetItem.GetComponent<Pickable>();
if (pickable == null)
{
canBeCompleted = false;
return;
}
//check if all the slots required by the item are free
foreach (InvSlotType slots in pickable.AllowedSlots)
{
@@ -112,8 +118,14 @@ namespace Barotrauma
/// </summary>
private void FindTargetItem()
{
float currDist = moveToTarget == null ? 0.0f : Vector2.DistanceSquared(moveToTarget.Position, character.Position);
if (itemName == null)
{
if (targetItem == null) canBeCompleted = false;
return;
}
float currDist = moveToTarget == null ? 0.0f : Vector2.DistanceSquared(moveToTarget.Position, character.Position);
for (int i = 0; i < 10 && currSearchIndex < Item.ItemList.Count - 2; i++)
{
currSearchIndex++;