diff --git a/apps/openmw_test_suite/detournavigator/asyncnavmeshupdater.cpp b/apps/openmw_test_suite/detournavigator/asyncnavmeshupdater.cpp index 71a833cc26..acfd5656b2 100644 --- a/apps/openmw_test_suite/detournavigator/asyncnavmeshupdater.cpp +++ b/apps/openmw_test_suite/detournavigator/asyncnavmeshupdater.cpp @@ -150,7 +150,7 @@ namespace serialize(mSettings.mRecast, mAgentBounds, *recastMesh, objects)); ASSERT_TRUE(tile.has_value()); EXPECT_EQ(tile->mTileId, 1); - EXPECT_EQ(tile->mVersion, navMeshVersion); + EXPECT_EQ(tile->mVersion, navMeshFormatVersion); } TEST_F(DetourNavigatorAsyncNavMeshUpdaterTest, post_when_writing_to_db_disabled_should_not_write_tiles) diff --git a/components/detournavigator/asyncnavmeshupdater.cpp b/components/detournavigator/asyncnavmeshupdater.cpp index e6b07d3f36..ee6cf453b8 100644 --- a/components/detournavigator/asyncnavmeshupdater.cpp +++ b/components/detournavigator/asyncnavmeshupdater.cpp @@ -92,7 +92,7 @@ namespace DetourNavigator { if (db == nullptr) return nullptr; - return std::make_unique(updater, std::move(db), TileVersion(navMeshVersion), + return std::make_unique(updater, std::move(db), TileVersion(navMeshFormatVersion), settings.mRecast, settings.mWriteToNavMeshDb); } @@ -483,7 +483,7 @@ namespace DetourNavigator std::unique_ptr preparedNavMeshData; bool generatedNavMeshData = false; - if (job.mCachedTileData.has_value() && job.mCachedTileData->mVersion == navMeshVersion) + if (job.mCachedTileData.has_value() && job.mCachedTileData->mVersion == navMeshFormatVersion) { preparedNavMeshData = std::make_unique(); if (deserialize(job.mCachedTileData->mData, *preparedNavMeshData)) diff --git a/components/detournavigator/generatenavmeshtile.cpp b/components/detournavigator/generatenavmeshtile.cpp index 41b60d4a75..2beb9d6468 100644 --- a/components/detournavigator/generatenavmeshtile.cpp +++ b/components/detournavigator/generatenavmeshtile.cpp @@ -73,7 +73,7 @@ namespace DetourNavigator std::vector input = serialize(mSettings.mRecast, mAgentBounds, *recastMesh, objects); const std::optional info = consumer->find(mWorldspace, mTilePosition, input); - if (info.has_value() && info->mVersion == navMeshVersion) + if (info.has_value() && info->mVersion == navMeshFormatVersion) { consumer->identity(mWorldspace, mTilePosition, info->mTileId); ignore.mConsumer = nullptr; @@ -86,9 +86,9 @@ namespace DetourNavigator return; if (info.has_value()) - consumer->update(mWorldspace, mTilePosition, info->mTileId, navMeshVersion, *data); + consumer->update(mWorldspace, mTilePosition, info->mTileId, navMeshFormatVersion, *data); else - consumer->insert(mWorldspace, mTilePosition, navMeshVersion, input, *data); + consumer->insert(mWorldspace, mTilePosition, navMeshFormatVersion, input, *data); ignore.mConsumer = nullptr; } diff --git a/components/detournavigator/settings.hpp b/components/detournavigator/settings.hpp index 67e0a5a958..45bcf15dbf 100644 --- a/components/detournavigator/settings.hpp +++ b/components/detournavigator/settings.hpp @@ -53,7 +53,7 @@ namespace DetourNavigator std::uint64_t mMaxDbFileSize = 0; }; - inline constexpr std::int64_t navMeshVersion = 2; + inline constexpr std::int64_t navMeshFormatVersion = 2; RecastSettings makeRecastSettingsFromSettingsManager();