diff --git a/components/detournavigator/navigatorimpl.cpp b/components/detournavigator/navigatorimpl.cpp index b973747c9c..181e950fdc 100644 --- a/components/detournavigator/navigatorimpl.cpp +++ b/components/detournavigator/navigatorimpl.cpp @@ -16,7 +16,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);