mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Add minetest.clear_registered_biomes() api
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user