Fix craftitem aliases
parent
62f7f72d20
commit
44e36d9aad
|
@ -85,8 +85,16 @@ public:
|
||||||
{
|
{
|
||||||
clear();
|
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<std::string, std::string>::const_iterator i;
|
||||||
|
i = m_aliases.find(itemname);
|
||||||
|
if(i != m_aliases.end()){
|
||||||
|
itemname = i->second;
|
||||||
|
}
|
||||||
|
// Get the definition
|
||||||
core::map<std::string, CraftItemDefinition*>::Node *n;
|
core::map<std::string, CraftItemDefinition*>::Node *n;
|
||||||
n = m_item_definitions.find(itemname);
|
n = m_item_definitions.find(itemname);
|
||||||
if(n == NULL)
|
if(n == NULL)
|
||||||
|
|
Loading…
Reference in New Issue