Recast: fix crash caused by traverse link table render selector

Out of bounds access caused when a navmesh is loaded with a smaller amount of tables than currently selected. Always reset the selector when loading/building.
This commit is contained in:
Kawe Mazidjatari 2024-08-16 20:45:17 +02:00
parent a3e4191cae
commit d4c3eb8dcc
2 changed files with 2 additions and 0 deletions

View File

@ -1341,6 +1341,7 @@ bool Editor::loadNavMesh(const char* path, const bool fullPath)
m_navQuery->init(m_navMesh, 2048);
m_loadedNavMeshType = m_selectedNavMeshType;
m_traverseLinkParams.traverseAnimType = -2;
if (m_tool)
{

View File

@ -472,6 +472,7 @@ bool Editor_TileMesh::handleBuild()
}
m_loadedNavMeshType = m_selectedNavMeshType;
m_traverseLinkParams.traverseAnimType = -2;
dtNavMeshParams params;
rdVcopy(params.orig, m_geom->getNavMeshBoundsMin());