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.
This commit is contained in:
Kawe Mazidjatari 2024-08-22 23:45:28 +02:00
parent 50e0e6ec58
commit 7a963c7fb3

View File

@ -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);
}
}
}