mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-18 17:36:45 +00:00
Merge branch 'navmesh_db_fallback' into 'master'
Disable navmesh disk cache when db is failed to open See merge request OpenMW/openmw!1672
This commit is contained in:
commit
f674c4ac73
1 changed files with 12 additions and 1 deletions
|
@ -3,6 +3,8 @@
|
||||||
#include "navigatorstub.hpp"
|
#include "navigatorstub.hpp"
|
||||||
#include "recastglobalallocator.hpp"
|
#include "recastglobalallocator.hpp"
|
||||||
|
|
||||||
|
#include <components/debug/debuglog.hpp>
|
||||||
|
|
||||||
namespace DetourNavigator
|
namespace DetourNavigator
|
||||||
{
|
{
|
||||||
std::unique_ptr<Navigator> makeNavigator(const Settings& settings, const std::string& userDataPath)
|
std::unique_ptr<Navigator> makeNavigator(const Settings& settings, const std::string& userDataPath)
|
||||||
|
@ -11,7 +13,16 @@ namespace DetourNavigator
|
||||||
|
|
||||||
std::unique_ptr<NavMeshDb> db;
|
std::unique_ptr<NavMeshDb> db;
|
||||||
if (settings.mEnableNavMeshDiskCache)
|
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));
|
return std::make_unique<NavigatorImpl>(settings, std::move(db));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue