Recast: fix crash caused by null navmesh

Make sure there is a navmesh before attempting to build static pathing data. The crash gets triggered when loading geometry, and trying to build a tile without generating the navmesh first.
This commit is contained in:
Kawe Mazidjatari 2024-07-15 17:09:01 +02:00
parent 400a71ae05
commit 13db18f700

View File

@ -344,6 +344,8 @@ void Editor::handleUpdate(const float dt)
void Editor::buildStaticPathingData()
{
if (!m_navMesh) return;
dtDisjointSet data;
if (!dtCreateDisjointPolyGroups(m_navMesh, data))