mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Recast: fix off-mesh connection remap during prune
Off-mesh connections were not properly mapped to their polygon instance, causing a heap buffer overflow.
This commit is contained in:
parent
d9db7d3d15
commit
49907272fb
@ -1362,19 +1362,13 @@ bool dtUpdateNavMeshData(dtNavMesh* nav, const unsigned int tileIndex)
|
||||
if (!(poly.flags & DT_POLYFLAGS_JUMP_LINKED))
|
||||
continue;
|
||||
|
||||
for (int c = 0; c < header->offMeshConCount; c++)
|
||||
{
|
||||
const dtOffMeshConnection& conn = tile->offMeshCons[c];
|
||||
const int conIdx = i-header->offMeshBase;
|
||||
|
||||
if (conn.poly != i)
|
||||
continue;
|
||||
const dtOffMeshConnection& conn = tile->offMeshCons[conIdx];
|
||||
rdAssert(conn.poly == i);
|
||||
|
||||
oldOffMeshConnIdMap[c] = offMeshConCount;
|
||||
newOffMeshConnIdMap[offMeshConCount] = c;
|
||||
|
||||
offMeshConCount++;
|
||||
break;
|
||||
}
|
||||
oldOffMeshConnIdMap[offMeshConCount] = conIdx;
|
||||
newOffMeshConnIdMap[conIdx] = offMeshConCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user