Inventory.FindItem takes the aliases of the items into account (-> possible to change item names without breaking crew AIs and the tutorial)

This commit is contained in:
Joonas Rikkonen
2017-12-17 22:40:30 +02:00
parent 33f0b1c967
commit 65fb67df54

View File

@@ -144,7 +144,7 @@ namespace Barotrauma
{
if (itemName == null) return null;
return Items.FirstOrDefault(i => i != null && (i.Name == itemName || i.HasTag(itemName)));
return Items.FirstOrDefault(i => i != null && (i.Prefab.NameMatches(itemName) || i.HasTag(itemName)));
}
public virtual void RemoveItem(Item item)