Do not try to update tile to post

changedTiles contains unique set of positions and tilesToPost is empty initially
therefore it's not possible to add the same position twice.
crashfix_debugdraw
elsid 2 years ago
parent c4d357df0f
commit d1a294664e
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -177,16 +177,8 @@ namespace DetourNavigator
const auto locked = cached->lockConst();
const auto& navMesh = locked->getImpl();
for (const auto& [tilePosition, changeType] : changedTiles)
{
if (navMesh.getTileAt(tilePosition.x(), tilePosition.y(), 0))
{
auto tileToPost = tilesToPost.find(tilePosition);
if (tileToPost == tilesToPost.end())
tilesToPost.emplace(tilePosition, changeType);
else
tileToPost->second = addChangeType(tileToPost->second, changeType);
}
}
tilesToPost.emplace(tilePosition, changeType);
const auto maxTiles = std::min(mSettings.mMaxTilesNumber, navMesh.getParams()->maxTiles);
mRecastMeshManager.forEachTile([&] (const TilePosition& tile, CachedRecastMeshManager& recastMeshManager)
{

Loading…
Cancel
Save