Merge pull request #95 from Sandern/fix-oldtile-not-removed

Make sure to remove the old tile if the new tile is empty (due to temp obstacles)
This commit is contained in:
Jakob Botsch Nielsen 2015-12-17 14:06:30 +01:00
commit d742e04cc4

View File

@ -631,7 +631,11 @@ dtStatus dtTileCache::buildNavMeshTile(const dtCompressedTileRef ref, dtNavMesh*
// Early out if the mesh tile is empty.
if (!bc.lmesh->npolys)
{
// Remove existing tile.
navmesh->removeTile(navmesh->getTileRefAt(tile->header->tx,tile->header->ty,tile->header->tlayer),0,0);
return DT_SUCCESS;
}
dtNavMeshCreateParams params;
memset(&params, 0, sizeof(params));