From 79afdf08feac26a36be41c27698c3ef86c39b102 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:04:55 +0200 Subject: [PATCH] Recast: fix editor crash in prune tool Always reset flags buffer as polygon references will no longer align with flags buffer on rebuild. --- src/naveditor/NavMeshPruneTool.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/naveditor/NavMeshPruneTool.cpp b/src/naveditor/NavMeshPruneTool.cpp index 124e3df7..14aca0a3 100644 --- a/src/naveditor/NavMeshPruneTool.cpp +++ b/src/naveditor/NavMeshPruneTool.cpp @@ -222,20 +222,26 @@ NavMeshPruneTool::NavMeshPruneTool() : NavMeshPruneTool::~NavMeshPruneTool() { - delete m_flags; + if (m_flags) + delete m_flags; } void NavMeshPruneTool::init(Editor* editor) { m_editor = editor; + reset(); } void NavMeshPruneTool::reset() { m_hitPosSet = false; m_ranPruneTool = false; - delete m_flags; - m_flags = 0; + + if (m_flags) + { + delete m_flags; + m_flags = 0; + } } void NavMeshPruneTool::handleMenu()