diff --git a/src/naveditor/Editor.cpp b/src/naveditor/Editor.cpp index 4283174e..90395bbb 100644 --- a/src/naveditor/Editor.cpp +++ b/src/naveditor/Editor.cpp @@ -862,12 +862,12 @@ void Editor::renderDetourDebugMenu() if (ImGui::Checkbox("Traverse Links", &isEnabled)) toggleNavMeshDrawFlag(DU_DRAWNAVMESH_TRAVERSE_LINKS); - if (isEnabled) + if (isEnabled && m_navMesh) // Supplemental options only available with a valid navmesh! { ImGui::PushItemWidth(190); ImGui::SliderInt("Traverse Type", &m_traverseLinkParams.traverseLinkType, -1, 31); ImGui::SliderInt("Traverse Dist", &m_traverseLinkParams.traverseLinkDistance, -1, 255); - ImGui::SliderInt("Traverse Anim", &m_traverseLinkParams.traverseAnimType, -1, m_navMesh->getParams()->traverseTableCount-1); + ImGui::SliderInt("Traverse Anim", &m_traverseLinkParams.traverseAnimType, -2, m_navMesh->getParams()->traverseTableCount-1); ImGui::PopItemWidth(); } } diff --git a/src/thirdparty/recast/DebugUtils/Include/DetourDebugDraw.h b/src/thirdparty/recast/DebugUtils/Include/DetourDebugDraw.h index 93ae0d9e..5093739a 100644 --- a/src/thirdparty/recast/DebugUtils/Include/DetourDebugDraw.h +++ b/src/thirdparty/recast/DebugUtils/Include/DetourDebugDraw.h @@ -48,11 +48,14 @@ struct duDrawTraverseLinkParams duDrawTraverseLinkParams() : traverseLinkType(-1), traverseLinkDistance(-1), - traverseAnimType(-1) + traverseAnimType(-2) {} int traverseLinkType; int traverseLinkDistance; + + // -2 means all, -1 means disjoint poly groups only, anything above + // refers to an actual anim type and indexes into the traverse tables. int traverseAnimType; }; diff --git a/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp b/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp index bd627f95..a13510ec 100644 --- a/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp +++ b/src/thirdparty/recast/DebugUtils/Source/DetourDebugDraw.cpp @@ -171,9 +171,9 @@ static void drawTraverseLinks(duDebugDraw* dd, const dtNavMesh& mesh, const dtNa const int drawAnimType = traverseLinkParams.traverseAnimType; const dtPolyRef basePolyRef = mesh.getPolyRefBase(tile) | (dtPolyRef)i; - if (drawAnimType != -1 && - !mesh.isGoalPolyReachable(basePolyRef, link->ref, false, drawAnimType) && - !mesh.isGoalPolyReachable(link->ref, basePolyRef, false, drawAnimType)) + if (drawAnimType != -2 && + !mesh.isGoalPolyReachable(basePolyRef, link->ref, drawAnimType == -1, drawAnimType) && + !mesh.isGoalPolyReachable(link->ref, basePolyRef, drawAnimType == -1, drawAnimType)) continue; const dtPoly* endPoly;