mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-19 15:39:49 +00:00
Handle failed NavMesh allocation
This commit is contained in:
parent
a6260453ea
commit
0985d8e03d
1 changed files with 4 additions and 0 deletions
|
@ -495,6 +495,10 @@ namespace DetourNavigator
|
|||
params.maxPolys = 1 << polysBits;
|
||||
|
||||
NavMeshPtr navMesh(dtAllocNavMesh(), &dtFreeNavMesh);
|
||||
|
||||
if (navMesh == nullptr)
|
||||
throw NavigatorException("Failed to allocate navmesh");
|
||||
|
||||
const auto status = navMesh->init(¶ms);
|
||||
|
||||
if (!dtStatusSucceed(status))
|
||||
|
|
Loading…
Reference in a new issue