From 98a8898a434b0374ca46a472ff601ab57f93fb1c Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Thu, 18 Jul 2024 17:05:08 +0200 Subject: [PATCH] Recast: fix bug in dtNavMesh::findNearestPolyInTile (XZY -> XYZ) Hight should always be on the Z axis. --- src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp index 231b4f59..1eec5f7b 100644 --- a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp +++ b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp @@ -854,7 +854,7 @@ dtPolyRef dtNavMesh::findNearestPolyInTile(const dtMeshTile* tile, rdVsub(diff, center, closestPtPoly); if (posOverPoly) { - d = rdAbs(diff[1]) - tile->header->walkableClimb; + d = rdAbs(diff[2]) - tile->header->walkableClimb; d = d > 0 ? d*d : 0; } else