From: Perttu Ahola Date: Sat, 3 Dec 2011 22:44:29 +0000 (+0200) Subject: Fix craftitem aliases X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=44e36d9aaddb93b0ec0e38561c745a1182536752;p=zefram%2Fminetest%2Fminetest_engine.git Fix craftitem aliases --- diff --git a/src/craftitemdef.cpp b/src/craftitemdef.cpp index 622c5c65..8d4cbea3 100644 --- a/src/craftitemdef.cpp +++ b/src/craftitemdef.cpp @@ -85,8 +85,16 @@ public: { clear(); } - virtual const CraftItemDefinition* getCraftItemDefinition(const std::string &itemname) const + virtual const CraftItemDefinition* getCraftItemDefinition(const std::string &itemname_) const { + // Convert name according to possible alias + std::string itemname = itemname_; + std::map::const_iterator i; + i = m_aliases.find(itemname); + if(i != m_aliases.end()){ + itemname = i->second; + } + // Get the definition core::map::Node *n; n = m_item_definitions.find(itemname); if(n == NULL)