From 38223fb6f3c9c0d42d51f14284293b19aca7a9e8 Mon Sep 17 00:00:00 2001 From: Amos Date: Sun, 21 Jul 2024 23:23:48 +0200 Subject: [PATCH] Recast: properly skip over intermediate poly data Needs to be multiplied by sizeof(int). --- src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp index 9df05f8e..d0928768 100644 --- a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp +++ b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp @@ -1069,7 +1069,7 @@ dtStatus dtNavMesh::addTile(unsigned char* data, int dataSize, int flags, tile->verts = rdGetThenAdvanceBufferPointer(d, vertsSize); tile->polys = rdGetThenAdvanceBufferPointer(d, polysSize); tile->polysEnd = &tile->polys[polyCount]; - d = (unsigned char*)(tile->polysEnd) + polyCount * unkPerPoly; + d = (unsigned char*)(tile->polysEnd) + (polyCount * unkPerPoly) * sizeof(int); tile->links = rdGetThenAdvanceBufferPointer(d, linksSize); tile->detailMeshes = rdGetThenAdvanceBufferPointer(d, detailMeshesSize); tile->detailVerts = rdGetThenAdvanceBufferPointer(d, detailVertsSize);