summaryrefslogtreecommitdiff
path: root/src/mg_schematic.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-03-30 23:40:35 -0400
committerkwolekr <kwolekr@minetest.net>2015-03-31 01:11:51 -0400
commited10005d381580440558dc49277b4d350f081283 (patch)
treea1ac2b831d883f6c43193a1c2a55860bf7e0d6ed /src/mg_schematic.cpp
parent6a48844eba16fb955ef4992bef539af66c595d0c (diff)
downloadminetest-ed10005d381580440558dc49277b4d350f081283.tar.gz
minetest-ed10005d381580440558dc49277b4d350f081283.tar.bz2
minetest-ed10005d381580440558dc49277b4d350f081283.zip
GenElementManager: Pass opaque handles to Lua and rename to ObjDefManager
Add core.clear_registered_schematics() and refactor schematics somewhat
Diffstat (limited to 'src/mg_schematic.cpp')
-rw-r--r--src/mg_schematic.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mg_schematic.cpp b/src/mg_schematic.cpp
index 23b62115f..f154f4fda 100644
--- a/src/mg_schematic.cpp
+++ b/src/mg_schematic.cpp
@@ -28,13 +28,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "serialization.h"
#include "filesys.h"
-const char *SchematicManager::ELEMENT_TITLE = "schematic";
-
///////////////////////////////////////////////////////////////////////////////
SchematicManager::SchematicManager(IGameDef *gamedef) :
- GenElementManager(gamedef)
+ ObjDefManager(gamedef, OBJDEF_SCHEMATIC)
{
}
@@ -201,7 +199,7 @@ void Schematic::placeStructure(Map *map, v3s16 p, u32 flags, Rotation rot,
bool Schematic::loadSchematicFromFile(const char *filename, INodeDefManager *ndef,
- std::map<std::string, std::string> &replace_names)
+ StringMap *replace_names)
{
content_t cignore = CONTENT_IGNORE;
bool have_cignore = false;
@@ -246,8 +244,8 @@ bool Schematic::loadSchematicFromFile(const char *filename, INodeDefManager *nde
}
std::map<std::string, std::string>::iterator it;
- it = replace_names.find(name);
- if (it != replace_names.end())
+ it = replace_names->find(name);
+ if (it != replace_names->end())
name = it->second;
nri->nodenames.push_back(name);