aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-12-06 18:08:08 -0500
committerkwolekr <kwolekr@minetest.net>2014-12-06 18:08:23 -0500
commit60feb4ad25003b4ed5f93f7fda7f4b8177a0ba51 (patch)
tree1b4a9e41b4bea77463cc1fb144ff88bfd790c404 /src/mapgen.cpp
parentf3abaec83be741094ef1b0949e3400fb16729f97 (diff)
downloadminetest-60feb4ad25003b4ed5f93f7fda7f4b8177a0ba51.tar.gz
minetest-60feb4ad25003b4ed5f93f7fda7f4b8177a0ba51.tar.bz2
minetest-60feb4ad25003b4ed5f93f7fda7f4b8177a0ba51.zip
Add minetest.clear_registered_biomes() api
Diffstat (limited to 'src/mapgen.cpp')
-rw-r--r--src/mapgen.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp
index 44ce0c615..880ea1eea 100644
--- a/src/mapgen.cpp
+++ b/src/mapgen.cpp
@@ -419,22 +419,17 @@ GenElement *GenElementManager::get(u32 id)
}
-GenElement *GenElementManager::getByName(const char *name)
+GenElement *GenElementManager::getByName(const std::string &name)
{
for (size_t i = 0; i != m_elements.size(); i++) {
GenElement *elem = m_elements[i];
- if (elem && !strcmp(elem->name.c_str(), name))
+ if (elem && name == elem->name)
return elem;
}
return NULL;
}
-GenElement *GenElementManager::getByName(std::string &name)
-{
- return getByName(name.c_str());
-}
-
GenElement *GenElementManager::update(u32 id, GenElement *elem)
{
@@ -451,3 +446,9 @@ GenElement *GenElementManager::remove(u32 id)
{
return update(id, NULL);
}
+
+
+void GenElementManager::clear()
+{
+ m_elements.clear();
+}