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:
@@ -143,10 +143,21 @@ namespace Barotrauma
|
||||
public Item FindItem(string itemName)
|
||||
{
|
||||
if (itemName == null) return null;
|
||||
|
||||
return Items.FirstOrDefault(i => i != null && (i.Prefab.NameMatches(itemName) || i.HasTag(itemName)));
|
||||
}
|
||||
|
||||
public Item FindItem(string[] itemNames)
|
||||
{
|
||||
if (itemNames == null) return null;
|
||||
|
||||
foreach (string itemName in itemNames)
|
||||
{
|
||||
var item = FindItem(itemName);
|
||||
if (item != null) return item;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual void RemoveItem(Item item)
|
||||
{
|
||||
if (item == null) return;
|
||||
|
||||
Reference in New Issue
Block a user