Fixed a links issue due to offmesh connections
When creating the tile's links, offmesh connections inside the tile were added twice, leading to the array of links being full and not being able to store the links computed after (portals between tiles).
This commit is contained in:
parent
36183edb55
commit
16bea738b8
@ -943,7 +943,10 @@ dtStatus dtNavMesh::addTile(unsigned char* data, int dataSize, int flags,
|
|||||||
tile->flags = flags;
|
tile->flags = flags;
|
||||||
|
|
||||||
connectIntLinks(tile);
|
connectIntLinks(tile);
|
||||||
|
|
||||||
|
// Base off-mesh connections to their starting polygons and connect connections inside the tile.
|
||||||
baseOffMeshLinks(tile);
|
baseOffMeshLinks(tile);
|
||||||
|
connectExtOffMeshLinks(tile, tile, -1);
|
||||||
|
|
||||||
// Create connections with neighbour tiles.
|
// Create connections with neighbour tiles.
|
||||||
static const int MAX_NEIS = 32;
|
static const int MAX_NEIS = 32;
|
||||||
@ -954,11 +957,11 @@ dtStatus dtNavMesh::addTile(unsigned char* data, int dataSize, int flags,
|
|||||||
nneis = getTilesAt(header->x, header->y, neis, MAX_NEIS);
|
nneis = getTilesAt(header->x, header->y, neis, MAX_NEIS);
|
||||||
for (int j = 0; j < nneis; ++j)
|
for (int j = 0; j < nneis; ++j)
|
||||||
{
|
{
|
||||||
if (neis[j] != tile)
|
if (neis[j] == tile)
|
||||||
{
|
continue;
|
||||||
connectExtLinks(tile, neis[j], -1);
|
|
||||||
connectExtLinks(neis[j], tile, -1);
|
connectExtLinks(tile, neis[j], -1);
|
||||||
}
|
connectExtLinks(neis[j], tile, -1);
|
||||||
connectExtOffMeshLinks(tile, neis[j], -1);
|
connectExtOffMeshLinks(tile, neis[j], -1);
|
||||||
connectExtOffMeshLinks(neis[j], tile, -1);
|
connectExtOffMeshLinks(neis[j], tile, -1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user