From 3a17d60182b542ad49f265ae16f67cca199034b0 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 21 Aug 2024 02:24:59 +0200 Subject: [PATCH] Recast: don't add tiles tagged as userId=1 Engine behavior. --- src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp index 7b3a4c45..14d8a718 100644 --- a/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp +++ b/src/thirdparty/recast/Detour/Source/DetourNavMesh.cpp @@ -1021,7 +1021,7 @@ dtStatus dtNavMesh::addTile(unsigned char* data, int dataSize, int flags, #endif // Make sure the location is free. - if (getTileAt(header->x, header->y, header->layer)) + if (!header->userId != 1 && getTileAt(header->x, header->y, header->layer)) return DT_FAILURE | DT_ALREADY_OCCUPIED; // Allocate a tile. @@ -1070,9 +1070,12 @@ dtStatus dtNavMesh::addTile(unsigned char* data, int dataSize, int flags, tile->deleteCallback = nullptr; // Insert tile into the position lut. - int h = computeTileHash(header->x, header->y, m_tileLutMask); - tile->next = m_posLookup[h]; - m_posLookup[h] = tile; + if (header->userId != 1) + { + int h = computeTileHash(header->x, header->y, m_tileLutMask); + tile->next = m_posLookup[h]; + m_posLookup[h] = tile; + } // Patch header pointers. const int headerSize = rdAlign4(sizeof(dtMeshHeader));