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