From d669d18a86573df58490de9d1809dc2076fec820 Mon Sep 17 00:00:00 2001 From: Amos Date: Fri, 26 Jul 2024 00:25:10 +0200 Subject: [PATCH] Recast: add missing mset version directive Not for MSET < 7. --- src/thirdparty/recast/Detour/Include/DetourNavMesh.h | 2 ++ src/thirdparty/recast/Detour/Source/DetourNavMeshBuilder.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/thirdparty/recast/Detour/Include/DetourNavMesh.h b/src/thirdparty/recast/Detour/Include/DetourNavMesh.h index ad4c332a..695e9aaa 100644 --- a/src/thirdparty/recast/Detour/Include/DetourNavMesh.h +++ b/src/thirdparty/recast/Detour/Include/DetourNavMesh.h @@ -229,12 +229,14 @@ struct dtPoly /// The poly surface area. (Quantized by #DT_POLY_AREA_QUANT_FACTOR). unsigned short surfaceArea; +#if DT_NAVMESH_SET_VERSION >= 7 // These 2 are most likely related, it needs to be reversed still. // No use case has been found in the executable yet, its possible these are // used internally in the editor. Dynamic reverse engineering required to // confirm this. unsigned short unk1; unsigned short unk2; +#endif /// The center of the polygon; see abstracted script function 'Navmesh_RandomPositions'. float center[3]; diff --git a/src/thirdparty/recast/Detour/Source/DetourNavMeshBuilder.cpp b/src/thirdparty/recast/Detour/Source/DetourNavMeshBuilder.cpp index 4d443602..48ee6bdc 100644 --- a/src/thirdparty/recast/Detour/Source/DetourNavMeshBuilder.cpp +++ b/src/thirdparty/recast/Detour/Source/DetourNavMeshBuilder.cpp @@ -296,10 +296,12 @@ bool dtCreateDisjointPolyGroups(dtNavMesh* nav, dtDisjointSet& disjoint) dtPoly& poly = tile->polys[j]; poly.groupId = DT_NULL_POLY_GROUP; +#if DT_NAVMESH_SET_VERSION >= 7 // NOTE: these fields are unknown and need to be reversed. // It is possible these are used internally only. poly.unk1 = (unsigned short)-1; poly.unk2 = (unsigned short)-1; +#endif } }