From 08a6d9e2cf8ad1464545132e566905252c4fb528 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Fri, 9 Dec 2022 16:43:15 +0100 Subject: [PATCH] Ignore non-3D agents in the navigator --- components/detournavigator/navigatorimpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/detournavigator/navigatorimpl.cpp b/components/detournavigator/navigatorimpl.cpp index 45f2f56d3d..08d4136486 100644 --- a/components/detournavigator/navigatorimpl.cpp +++ b/components/detournavigator/navigatorimpl.cpp @@ -18,7 +18,8 @@ namespace DetourNavigator void NavigatorImpl::addAgent(const AgentBounds& agentBounds) { - if(agentBounds.mHalfExtents.length2() <= 0) + if (agentBounds.mHalfExtents.x() == 0.f || agentBounds.mHalfExtents.y() == 0.f + || agentBounds.mHalfExtents.z() == 0.f) return; ++mAgents[agentBounds]; mNavMeshManager.addAgent(agentBounds);