From 5936d865b576c62844f3fb3374b2a038c924f624 Mon Sep 17 00:00:00 2001 From: KimLS Date: Thu, 16 May 2019 14:37:52 -0700 Subject: [PATCH] Apply patches to recast --- .../recastnavigation/Detour/Source/DetourNavMeshQuery.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp b/libs/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp index 839ee1e81..49b741446 100644 --- a/libs/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp +++ b/libs/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp @@ -1032,7 +1032,9 @@ dtStatus dtNavMeshQuery::findPath(dtPolyRef startRef, dtPolyRef endRef, // The API input has been cheked already, skip checking internal data. const dtMeshTile* neighbourTile = 0; const dtPoly* neighbourPoly = 0; - m_nav->getTileAndPolyByRefUnsafe(neighbourRef, &neighbourTile, &neighbourPoly); + if (dtStatusFailed(m_nav->getTileAndPolyByRef(neighbourRef, &neighbourTile, &neighbourPoly))) { + continue; + } if (!filter->passFilter(neighbourRef, neighbourTile, neighbourPoly)) continue; @@ -1345,7 +1347,9 @@ dtStatus dtNavMeshQuery::updateSlicedFindPath(const int maxIter, int* doneIters) // The API input has been cheked already, skip checking internal data. const dtMeshTile* neighbourTile = 0; const dtPoly* neighbourPoly = 0; - m_nav->getTileAndPolyByRefUnsafe(neighbourRef, &neighbourTile, &neighbourPoly); + if (dtStatusFailed(m_nav->getTileAndPolyByRef(neighbourRef, &neighbourTile, &neighbourPoly))) { + continue; + } if (!m_query.filter->passFilter(neighbourRef, neighbourTile, neighbourPoly)) continue;