aboutsummaryrefslogtreecommitdiff
path: root/src/itemdef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/itemdef.cpp')
-rw-r--r--src/itemdef.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/itemdef.cpp b/src/itemdef.cpp
index a618ad631..a6c627a03 100644
--- a/src/itemdef.cpp
+++ b/src/itemdef.cpp
@@ -466,11 +466,17 @@ public:
infostream<<"ItemDefManager: erased alias "<<def.name
<<" because item was defined"<<std::endl;
}
+ virtual void unregisterItem(const std::string &name)
+ {
+ verbosestream<<"ItemDefManager: unregistering \""<<name<<"\""<<std::endl;
+
+ delete m_item_definitions[name];
+ m_item_definitions.erase(name);
+ }
virtual void registerAlias(const std::string &name,
const std::string &convert_to)
{
- if(m_item_definitions.find(name) == m_item_definitions.end())
- {
+ if (m_item_definitions.find(name) == m_item_definitions.end()) {
verbosestream<<"ItemDefManager: setting alias "<<name
<<" -> "<<convert_to<<std::endl;
m_aliases[name] = convert_to;