From 7a963c7fb34f60585d9cbc6ffcd0634ac8afe62d Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Thu, 22 Aug 2024 23:45:28 +0200 Subject: [PATCH] Recast: properly restore off-mesh connection draw flags Instead of setting it to the old flags (undoing any changes we did while we were at the off-mesh connection tool) only set the off-mesh draw flag if it was enabled since that's the only one we disable when entering this tool. --- src/naveditor/OffMeshConnectionTool.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/naveditor/OffMeshConnectionTool.cpp b/src/naveditor/OffMeshConnectionTool.cpp index 3d1176e6..da44dfb4 100644 --- a/src/naveditor/OffMeshConnectionTool.cpp +++ b/src/naveditor/OffMeshConnectionTool.cpp @@ -40,7 +40,11 @@ OffMeshConnectionTool::~OffMeshConnectionTool() { if (m_editor) { - m_editor->setNavMeshDrawFlags(m_oldFlags); + if (m_oldFlags & DU_DRAWNAVMESH_OFFMESHCONS) + { + const unsigned int curFlags = m_editor->getNavMeshDrawFlags(); + m_editor->setNavMeshDrawFlags(curFlags | DU_DRAWNAVMESH_OFFMESHCONS); + } } }