aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2021-03-20 13:02:15 +0100
committerGitHub <noreply@github.com>2021-03-20 13:02:15 +0100
commit05719913aca97e53ff5b1dde49e1a033a327551f (patch)
treee775880bc19a4fd53f3b85362c6dc49edb8d4453 /src/script
parenta8cc3bdb0890c89d600ef6543c5e9b1b55bcf2b6 (diff)
downloadminetest-05719913aca97e53ff5b1dde49e1a033a327551f.tar.gz
minetest-05719913aca97e53ff5b1dde49e1a033a327551f.tar.bz2
minetest-05719913aca97e53ff5b1dde49e1a033a327551f.zip
Schematic: Properly deal with before/after node resolving and document (#11011)
This fixes an out-of-bounds index access when the node resolver was already applied to the schematic (i.e. biome decoration). Also improves the handling of the two cases: prior node resolving (m_nodenames), and after node resolving (manual lookup)
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_mapgen.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index 12a497b1e..cc93bdbd0 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -1734,11 +1734,10 @@ int ModApiMapgen::l_serialize_schematic(lua_State *L)
std::ostringstream os(std::ios_base::binary);
switch (schem_format) {
case SCHEM_FMT_MTS:
- schem->serializeToMts(&os, schem->m_nodenames);
+ schem->serializeToMts(&os);
break;
case SCHEM_FMT_LUA:
- schem->serializeToLua(&os, schem->m_nodenames,
- use_comments, indent_spaces);
+ schem->serializeToLua(&os, use_comments, indent_spaces);
break;
default:
return 0;