diff --git a/src/naveditor/Editor_TileMesh.cpp b/src/naveditor/Editor_TileMesh.cpp index 1df4a817..dcd6b812 100644 --- a/src/naveditor/Editor_TileMesh.cpp +++ b/src/naveditor/Editor_TileMesh.cpp @@ -811,7 +811,7 @@ void Editor_TileMesh::buildAllTiles() } // Reserve the first poly groups - // 0 = technically usable for normal poly groups, but for possible internal usage we reserve it for now. + // 0 = DT_NULL_POLY_GROUP. // 1 = DT_STRAY_POLY_GROUP. dtDisjointSet data(DT_FIRST_USABLE_POLY_GROUP); diff --git a/src/thirdparty/recast/Detour/Include/DetourNavMesh.h b/src/thirdparty/recast/Detour/Include/DetourNavMesh.h index 0eaeeb8b..40eef111 100644 --- a/src/thirdparty/recast/Detour/Include/DetourNavMesh.h +++ b/src/thirdparty/recast/Detour/Include/DetourNavMesh.h @@ -63,6 +63,9 @@ typedef unsigned int dtTileRef; /// @ingroup detour static const int DT_VERTS_PER_POLYGON = 6; +/// A value that indicates that this poly hasn't been assigned to a group yet. +static const unsigned short DT_NULL_POLY_GROUP = 0; + /// A poly group that holds all unconnected stray polys (not linked to anything). /// These are considered 'trash' by the game engine; see [r5apex_ds + CA88B2]. /// For reference, Titanfall 2 single player NavMeshes also marked everything unconnected as '1'. diff --git a/src/thirdparty/recast/Detour/Source/DetourNavMeshBuilder.cpp b/src/thirdparty/recast/Detour/Source/DetourNavMeshBuilder.cpp index 5e0833e2..fabee81a 100644 --- a/src/thirdparty/recast/Detour/Source/DetourNavMeshBuilder.cpp +++ b/src/thirdparty/recast/Detour/Source/DetourNavMeshBuilder.cpp @@ -294,7 +294,7 @@ bool dtCreateDisjointPolyGroups(dtNavMesh* nav, dtDisjointSet& disjoint) for (int j = 0; j < pcount; j++) { dtPoly& poly = tile->polys[j]; - poly.groupId = (unsigned short)-1; + poly.groupId = DT_NULL_POLY_GROUP; // NOTE: these fields are unknown and need to be reversed. // It is possible these are used internally only. @@ -332,7 +332,7 @@ bool dtCreateDisjointPolyGroups(dtNavMesh* nav, dtDisjointSet& disjoint) const dtPoly* p; nav->getTileAndPolyByRefUnsafe(l.ref, &t, &p); - if (p->groupId != (unsigned short)-1) + if (p->groupId != DT_NULL_POLY_GROUP) nlabels.insert(p->groupId); plink = l.next;