mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-06 00:40:04 +00:00
Disable navmesh disk cache when db is failed to open
This commit is contained in:
parent
1b3acc85f7
commit
8b4362ece7
@ -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…
x
Reference in New Issue
Block a user