diff options
author | kwolekr <kwolekr@minetest.net> | 2015-05-07 02:54:30 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-05-07 02:54:35 -0400 |
commit | b246812455737b2d0337dec905ba0256adefd105 (patch) | |
tree | cea90089c81f83011895a19e60d194c92379766b /src/script | |
parent | 656575b59d4f0d67452cca7409c9064f690f038c (diff) | |
download | minetest-b246812455737b2d0337dec905ba0256adefd105.tar.gz minetest-b246812455737b2d0337dec905ba0256adefd105.tar.bz2 minetest-b246812455737b2d0337dec905ba0256adefd105.zip |
Schematics: Add indent-with-space option for schematic Lua table serialization
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/lua_api/l_mapgen.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index d99f40ccd..7e9c07939 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -1134,7 +1134,8 @@ int ModApiMapgen::l_serialize_schematic(lua_State *L) SchematicManager *schemmgr = getServer(L)->getEmergeManager()->schemmgr; //// Read options - bool use_comments = getboolfield_default(L, 3, "use_lua_comments", false); + bool use_comments = getboolfield_default(L, 3, "lua_use_comments", false); + u32 indent_spaces = getintfield_default(L, 3, "lua_num_indent_spaces", 0); //// Get schematic bool was_loaded = false; @@ -1161,7 +1162,8 @@ int ModApiMapgen::l_serialize_schematic(lua_State *L) schem->serializeToMts(&os, schem->m_nodenames); break; case SCHEM_FMT_LUA: - schem->serializeToLua(&os, schem->m_nodenames, use_comments); + schem->serializeToLua(&os, schem->m_nodenames, + use_comments, indent_spaces); break; default: return 0; |