From 11512d9d28df1fe5f67a14174b67ca61a71ec5f0 Mon Sep 17 00:00:00 2001 From: RGreenlees Date: Mon, 24 Jun 2024 14:23:53 +0100 Subject: [PATCH] Update DetourTileCache.cpp --- main/source/detour/DetourTileCache.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/source/detour/DetourTileCache.cpp b/main/source/detour/DetourTileCache.cpp index 359a65f0..ba498afa 100644 --- a/main/source/detour/DetourTileCache.cpp +++ b/main/source/detour/DetourTileCache.cpp @@ -842,6 +842,8 @@ dtStatus dtTileCache::update(const float /*dt*/, dtNavMesh* navmesh, } + bool bOffMeshChanged = false; + if (m_nupdate == 0) { for (int i = 0; i < m_params.maxOffMeshConnections; ++i) @@ -854,6 +856,7 @@ dtStatus dtTileCache::update(const float /*dt*/, dtNavMesh* navmesh, navmesh->baseOffMeshLinks(con); navmesh->GlobalOffMeshLinks(con); con->state = DT_OFFMESH_CLEAN; + bOffMeshChanged = true; } if (con->state == DT_OFFMESH_REMOVING) @@ -869,7 +872,7 @@ dtStatus dtTileCache::update(const float /*dt*/, dtNavMesh* navmesh, } if (upToDate) - *upToDate = m_nupdate == 0 && m_nreqs == 0 && m_nOffMeshReqs == 0; + *upToDate = m_nupdate == 0 && m_nreqs == 0 && m_nOffMeshReqs == 0 && !bOffMeshChanged; return status; }