From 3ac33b86e5d64ffbc4da24dc08ae6b671ec34050 Mon Sep 17 00:00:00 2001 From: Diject Date: Sun, 28 Dec 2025 12:32:09 +0300 Subject: [PATCH] Disable navmesh updater worker threads by default --- components/detournavigator/asyncnavmeshupdater.cpp | 4 ++++ components/detournavigator/settings.cpp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/components/detournavigator/asyncnavmeshupdater.cpp b/components/detournavigator/asyncnavmeshupdater.cpp index d7eaafce9a..b8b24fa696 100644 --- a/components/detournavigator/asyncnavmeshupdater.cpp +++ b/components/detournavigator/asyncnavmeshupdater.cpp @@ -348,6 +348,10 @@ namespace DetourNavigator void AsyncNavMeshUpdater::wait(WaitConditionType waitConditionType, Loading::Listener* listener) { + // If there are no worker threads, jobs will never be processed, so don't wait + if (mThreads.empty()) + return; + switch (waitConditionType) { case WaitConditionType::requiredTilesPresent: diff --git a/components/detournavigator/settings.cpp b/components/detournavigator/settings.cpp index d71b3d12bc..d66040b48d 100644 --- a/components/detournavigator/settings.cpp +++ b/components/detournavigator/settings.cpp @@ -94,7 +94,6 @@ namespace DetourNavigator result.mMaxTilesNumber = std::min(limits.mMaxTiles, ::Settings::navigator().mMaxTilesNumber.get()); result.mWaitUntilMinDistanceToPlayer = ::Settings::navigator().mWaitUntilMinDistanceToPlayer; - result.mAsyncNavMeshUpdaterThreads = ::Settings::navigator().mAsyncNavMeshUpdaterThreads; result.mMaxNavMeshTilesCacheSize = ::Settings::navigator().mMaxNavMeshTilesCacheSize; result.mEnableWriteRecastMeshToFile = ::Settings::navigator().mEnableWriteRecastMeshToFile; result.mEnableWriteNavMeshToFile = ::Settings::navigator().mEnableWriteNavMeshToFile; @@ -106,6 +105,9 @@ namespace DetourNavigator result.mEnableNavMeshDiskCache = ::Settings::navigator().mEnableNavMeshDiskCache; result.mWriteToNavMeshDb = ::Settings::navigator().mWriteToNavmeshdb; result.mMaxDbFileSize = ::Settings::navigator().mMaxNavmeshdbFileSize; + + // Force disable navmesh generation worker threads regardless of config file settings + result.mAsyncNavMeshUpdaterThreads = 0; return result; }