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