diff --git a/Recast/Source/RecastMeshDetail.cpp b/Recast/Source/RecastMeshDetail.cpp index f497bca..431952f 100644 --- a/Recast/Source/RecastMeshDetail.cpp +++ b/Recast/Source/RecastMeshDetail.cpp @@ -512,12 +512,12 @@ static float polyMinExtent(const float* verts, const int nverts) inline int next(int i, int n) { - return (n+1) % n; + return (i+1) % n; } inline int prev(int i, int n) { - return (n+1) % n; + return (i + n-1) % n; } static void triangulateHull(const int nverts, const float* verts, const int nhull, const int* hull, rcIntArray& tris)