Clear all changed tiles after post

pull/541/head
elsid 6 years ago
parent 518e34b403
commit ce9aebcba1
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -172,10 +172,6 @@ namespace DetourNavigator
else
tileToPost->second = addChangeType(tileToPost->second, tile.second);
}
for (const auto& tile : tilesToPost)
changedTiles->second.erase(tile.first);
if (changedTiles->second.empty())
mChangedTiles.erase(changedTiles);
}
const auto maxTiles = std::min(mSettings.mMaxTilesNumber, navMesh.getParams()->maxTiles);
mRecastMeshManager.forEachTilePosition([&] (const TilePosition& tile)
@ -191,6 +187,8 @@ namespace DetourNavigator
});
}
mAsyncNavMeshUpdater.post(agentHalfExtents, cached, playerTile, tilesToPost);
if (changedTiles != mChangedTiles.end())
changedTiles->second.clear();
log("cache update posted for agent=", agentHalfExtents,
" playerTile=", lastPlayerTile->second,
" recastMeshManagerRevision=", lastRevision);

Loading…
Cancel
Save