mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-21 05:39:42 +00:00
Disable navmesh disk cache when db is failed to open
This commit is contained in:
parent
1b3acc85f7
commit
8b4362ece7
1 changed files with 12 additions and 1 deletions
|
@ -3,6 +3,8 @@
|
|||
#include "navigatorstub.hpp"
|
||||
#include "recastglobalallocator.hpp"
|
||||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
|
||||
namespace DetourNavigator
|
||||
{
|
||||
std::unique_ptr<Navigator> makeNavigator(const Settings& settings, const std::string& userDataPath)
|
||||
|
@ -11,7 +13,16 @@ namespace DetourNavigator
|
|||
|
||||
std::unique_ptr<NavMeshDb> db;
|
||||
if (settings.mEnableNavMeshDiskCache)
|
||||
db = std::make_unique<NavMeshDb>(userDataPath + "/navmesh.db");
|
||||
{
|
||||
try
|
||||
{
|
||||
db = std::make_unique<NavMeshDb>(userDataPath + "/navmesh.db");
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
Log(Debug::Error) << e.what() << ", navigation mesh disk cache will be disabled";
|
||||
}
|
||||
}
|
||||
|
||||
return std::make_unique<NavigatorImpl>(settings, std::move(db));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue