Move dtNavMeshParams initialization to where it's required

pull/3097/head
elsid 3 years ago
parent e89b304fed
commit 3cbe93358a
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -517,8 +517,6 @@ namespace DetourNavigator
" playerTile=(" << playerTile << ")" <<
" changedTileDistance=" << getDistance(changedTile, playerTile);
const auto params = *navMeshCacheItem->lockConst()->getImpl().getParams();
if (!recastMesh)
{
Log(Debug::Debug) << "Ignore add tile: recastMesh is null";
@ -542,6 +540,8 @@ namespace DetourNavigator
return navMeshCacheItem->lock()->removeTile(changedTile);
}
const dtNavMeshParams params = *navMeshCacheItem->lockConst()->getImpl().getParams();
if (!shouldAddTile(changedTile, playerTile, std::min(settings.mMaxTilesNumber, params.maxTiles)))
{
Log(Debug::Debug) << "Ignore add tile: too far from player";

Loading…
Cancel
Save