mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00: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:
parent
a8cc3bdb08
commit
05719913ac
7 changed files with 154 additions and 87 deletions
|
@ -1675,8 +1675,7 @@ bool NodeDefManager::nodeboxConnects(MapNode from, MapNode to,
|
|||
|
||||
NodeResolver::NodeResolver()
|
||||
{
|
||||
m_nodenames.reserve(16);
|
||||
m_nnlistsizes.reserve(4);
|
||||
reset();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1779,3 +1778,16 @@ bool NodeResolver::getIdsFromNrBacklog(std::vector<content_t> *result_out,
|
|||
|
||||
return success;
|
||||
}
|
||||
|
||||
void NodeResolver::reset(bool resolve_done)
|
||||
{
|
||||
m_nodenames.clear();
|
||||
m_nodenames_idx = 0;
|
||||
m_nnlistsizes.clear();
|
||||
m_nnlistsizes_idx = 0;
|
||||
|
||||
m_resolve_done = resolve_done;
|
||||
|
||||
m_nodenames.reserve(16);
|
||||
m_nnlistsizes.reserve(4);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue