Crew AI fixes:

- Characters can use oxygenite shards (or any other item with an "oxygensource" tag) in diving suits/masks.
- AIObjectiveFindDivingGear doesn't count as being completed if the character has diving gear in their inventory unless the character has equipped the gear.
- AIObjectiveGetItem doesn't count as being completed if equipping the target item is required and the character hasn't equipped it yet.
This commit is contained in:
Joonas Rikkonen
2017-12-28 12:53:23 +02:00
parent ccda925623
commit d074d3d443
7 changed files with 135 additions and 57 deletions
@@ -1045,6 +1045,17 @@ namespace Barotrauma
return !inventory.IsInLimbSlot(item, InvSlotType.Any);
}
public bool HasEquippedItem(string itemName)
{
for (int i = 0; i < inventory.Items.Length; i++)
{
if (CharacterInventory.limbSlots[i] == InvSlotType.Any || inventory.Items[i] == null) continue;
if (inventory.Items[i].Prefab.NameMatches(itemName) || inventory.Items[i].HasTag(itemName)) return true;
}
return false;
}
public bool HasSelectedItem(Item item)
{
return selectedItems.Contains(item);