From 13db18f700c6620bf768df7e44436edc2911e774 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:09:01 +0200 Subject: [PATCH] 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. --- src/naveditor/Editor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/naveditor/Editor.cpp b/src/naveditor/Editor.cpp index b890bc0a..5359c974 100644 --- a/src/naveditor/Editor.cpp +++ b/src/naveditor/Editor.cpp @@ -344,6 +344,8 @@ void Editor::handleUpdate(const float dt) void Editor::buildStaticPathingData() { + if (!m_navMesh) return; + dtDisjointSet data; if (!dtCreateDisjointPolyGroups(m_navMesh, data))