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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user