aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_mapgen.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index 7e9c07939..5422447ed 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -1031,10 +1031,9 @@ int ModApiMapgen::l_generate_decorations(lua_State *L)
// create_schematic(p1, p2, probability_list, filename, y_slice_prob_list)
int ModApiMapgen::l_create_schematic(lua_State *L)
{
- Schematic schem;
- schem.m_ndef = getServer(L)->getNodeDefManager();
-
+ INodeDefManager *ndef = getServer(L)->getNodeDefManager();
Map *map = &(getEnv(L)->getMap());
+ Schematic schem;
v3s16 p1 = check_v3s16(L, 1);
v3s16 p2 = check_v3s16(L, 2);
@@ -1081,7 +1080,7 @@ int ModApiMapgen::l_create_schematic(lua_State *L)
schem.applyProbabilities(p1, &prob_list, &slice_prob_list);
- schem.saveSchematicToFile(filename);
+ schem.saveSchematicToFile(filename, ndef);
actionstream << "create_schematic: saved schematic file '"
<< filename << "'." << std::endl;