Recast: properly skip over intermediate poly data

Needs to be multiplied by sizeof(int).
This commit is contained in:
Amos 2024-07-21 23:23:48 +02:00
parent bff3bfd5ea
commit 38223fb6f3

View File

@ -1069,7 +1069,7 @@ dtStatus dtNavMesh::addTile(unsigned char* data, int dataSize, int flags,
tile->verts = rdGetThenAdvanceBufferPointer<float>(d, vertsSize);
tile->polys = rdGetThenAdvanceBufferPointer<dtPoly>(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<dtLink>(d, linksSize);
tile->detailMeshes = rdGetThenAdvanceBufferPointer<dtPolyDetail>(d, detailMeshesSize);
tile->detailVerts = rdGetThenAdvanceBufferPointer<float>(d, detailVertsSize);