From ed10005d381580440558dc49277b4d350f081283 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Mon, 30 Mar 2015 23:40:35 -0400 Subject: GenElementManager: Pass opaque handles to Lua and rename to ObjDefManager Add core.clear_registered_schematics() and refactor schematics somewhat --- src/mg_schematic.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/mg_schematic.cpp') 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 &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::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); -- cgit v1.2.3