From 5a6c65519645b5ca3ae147b91fb7091f9e107960 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 2 Feb 2025 15:00:19 +0100 Subject: [PATCH] Recast: fix infinite loop in dtNavMeshQuery::raycast() Status changes, but the code never acts accordingly on the new status. --- src/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp b/src/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp index a50ca19e..ed130de3 100644 --- a/src/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp +++ b/src/thirdparty/recast/Detour/Source/DetourNavMeshQuery.cpp @@ -2712,6 +2712,12 @@ dtStatus dtNavMeshQuery::raycast(dtPolyRef startRef, const float* startPos, cons tile = nextTile; prevPoly = poly; poly = nextPoly; + + if (status & DT_BUFFER_TOO_SMALL) + { + status |= DT_PARTIAL_RESULT; + break; + } } hit->pathCount = n;