From 65fb67df540ce1fea9f51bffeee1b2f028861200 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 17 Dec 2017 22:40:30 +0200 Subject: [PATCH] Inventory.FindItem takes the aliases of the items into account (-> possible to change item names without breaking crew AIs and the tutorial) --- Barotrauma/BarotraumaShared/Source/Items/Inventory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Inventory.cs b/Barotrauma/BarotraumaShared/Source/Items/Inventory.cs index 669b68f34..77e20af31 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Inventory.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Inventory.cs @@ -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)