From 6a3bc50778fb0cf609558654cb8f460d3e3d2e0f Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 13 Jul 2024 00:39:58 +0200 Subject: [PATCH] Recast: dtCalcPolySurfaceArea cleanup j -> i. --- src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp index 1a277810..81304184 100644 --- a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp +++ b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp @@ -1701,11 +1701,11 @@ float dtCalcPolySurfaceArea(const dtPoly* poly, const float* verts) // Only run if we have more than 2 verts since poly's with 2 verts // (off-mesh connections) don't have any surface area. - for (int j = 2; j < poly->vertCount; ++j) + for (int i = 2; i < poly->vertCount; ++i) { const float* va = &verts[poly->verts[0]*3]; - const float* vb = &verts[poly->verts[j]*3]; - const float* vc = &verts[poly->verts[j-1]*3]; + const float* vb = &verts[poly->verts[i]*3]; + const float* vc = &verts[poly->verts[i-1]*3]; polyArea += dtTriArea2D(va,vb,vc); }