diff options
author | kwolekr <kwolekr@minetest.net> | 2015-05-08 00:05:08 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-05-08 00:55:42 -0400 |
commit | 2dba29ebf20e95068872b758a9c16daeb4c74440 (patch) | |
tree | 67a202271b962916f43e4e110ce0a269865c8718 /src/script/lua_api | |
parent | 33c11415bf9f05192c104c4bb38f579824addfa5 (diff) | |
download | minetest-2dba29ebf20e95068872b758a9c16daeb4c74440.tar.gz minetest-2dba29ebf20e95068872b758a9c16daeb4c74440.tar.bz2 minetest-2dba29ebf20e95068872b758a9c16daeb4c74440.zip |
Tests: Add schematic unittests
Improve schematic file-saving interface
Add ability to create temporary test files
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_mapgen.cpp | 7 |
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; |