From 2888930893a7cfa400e847b250770fae8323b808 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:03:14 +0200 Subject: [PATCH] Recast: explicitly init current tool Tool states aren't always set, they are typically only set for the active tool if an option changed, but if nothing changed, then nothing will get updated (including the navmesh handle) so dangling pointers will be used. This makes sure everything gets initialized. --- src/naveditor/Editor_Common.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/naveditor/Editor_Common.cpp b/src/naveditor/Editor_Common.cpp index e7822f02..20668dec 100644 --- a/src/naveditor/Editor_Common.cpp +++ b/src/naveditor/Editor_Common.cpp @@ -405,6 +405,14 @@ void Editor_StaticTileMeshCommon::renderIntermediateTileMeshOptions() m_navQuery->init(m_navMesh, 2048); m_loadedNavMeshType = m_selectedNavMeshType; + + if (m_tool) + { + m_tool->reset(); + m_tool->init(this); + } + + resetToolStates(); initToolStates(this); }