1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-03 11:45:34 +00:00

Move dtNavMeshParams initialization to where it's required

This commit is contained in:
elsid 2021-08-07 11:58:02 +02:00
parent e89b304fed
commit 3cbe93358a
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -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";