Core/MMaps: Fix infinite loop in Detour (ported commit: c602220e02bed1ad76c9e60064eeec5fd97bfe80)
This commit is contained in:
1 parent
b96f544f94
commit
bd58cb3ab1
4 files changed
+18
-7
No files matched your search
@@ -820,10 +820,12 @@ dtStatus PathGenerator::FindSmoothPath(float const* startPos, float const* endPo
|
||||
dtPolyRef visited[MAX_VISIT_POLY];
|
||||
|
||||
uint32 nvisited = 0;
|
||||
_navMeshQuery->moveAlongSurface(polys[0], iterPos, moveTgt, &_filter, result, visited, (int*)&nvisited, MAX_VISIT_POLY);
|
||||
if (dtStatusFailed(_navMeshQuery->moveAlongSurface(polys[0], iterPos, moveTgt, &_filter, result, visited, (int*)&nvisited, MAX_VISIT_POLY)))
|
||||
return DT_FAILURE;
|
||||
npolys = FixupCorridor(polys, npolys, MAX_PATH_LENGTH, visited, nvisited);
|
||||
|
||||
_navMeshQuery->getPolyHeight(polys[0], result, &result[1]);
|
||||
if (dtStatusFailed(_navMeshQuery->getPolyHeight(polys[0], result, &result[1])))
|
||||
return DT_FAILURE;
|
||||
result[1] += 0.5f;
|
||||
dtVcopy(iterPos, result);
|
||||
|
||||
@@ -868,7 +870,8 @@ dtStatus PathGenerator::FindSmoothPath(float const* startPos, float const* endPo
|
||||
}
|
||||
// Move position at the other side of the off-mesh link.
|
||||
dtVcopy(iterPos, connectionEndPos);
|
||||
_navMeshQuery->getPolyHeight(polys[0], iterPos, &iterPos[1]);
|
||||
if (dtStatusFailed(_navMeshQuery->getPolyHeight(polys[0], iterPos, &iterPos[1])))
|
||||
return DT_FAILURE;
|
||||
iterPos[1] += 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user