From c70fc8a89ab75b86a9c76ce290bf6309cff639c1 Mon Sep 17 00:00:00 2001 From: Matthew Endsley Date: Wed, 23 Aug 2017 22:02:45 -0700 Subject: [PATCH] Return OOM error when navmeshtile allocations fail This was previsously return a DT_SUCCESS mask, as the prior call to dtAllocTileCache* had succeeded. --- DetourTileCache/Source/DetourTileCache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DetourTileCache/Source/DetourTileCache.cpp b/DetourTileCache/Source/DetourTileCache.cpp index 707c192..a82cd13 100644 --- a/DetourTileCache/Source/DetourTileCache.cpp +++ b/DetourTileCache/Source/DetourTileCache.cpp @@ -706,7 +706,7 @@ dtStatus dtTileCache::buildNavMeshTile(const dtCompressedTileRef ref, dtNavMesh* bc.lcset = dtAllocTileCacheContourSet(m_talloc); if (!bc.lcset) - return status; + return DT_FAILURE | DT_OUT_OF_MEMORY; status = dtBuildTileCacheContours(m_talloc, *bc.layer, walkableClimbVx, m_params.maxSimplificationError, *bc.lcset); if (dtStatusFailed(status)) @@ -714,7 +714,7 @@ dtStatus dtTileCache::buildNavMeshTile(const dtCompressedTileRef ref, dtNavMesh* bc.lmesh = dtAllocTileCachePolyMesh(m_talloc); if (!bc.lmesh) - return status; + return DT_FAILURE | DT_OUT_OF_MEMORY; status = dtBuildTileCachePolyMesh(m_talloc, *bc.lcset, *bc.lmesh); if (dtStatusFailed(status)) return status;