mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02:00
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)
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user