From 7596f44655a8d2a3ef173ac4efcb32dc79e1e5c5 Mon Sep 17 00:00:00 2001 From: Amos <48657826+Mauler125@users.noreply.github.com> Date: Wed, 16 Mar 2022 01:35:29 +0100 Subject: [PATCH] Fix alignment --- r5dev/thirdparty/recast/Detour/Include/DetourNavMesh.h | 9 +++++---- r5dev/thirdparty/recast/Detour/Source/DetourNavMesh.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/r5dev/thirdparty/recast/Detour/Include/DetourNavMesh.h b/r5dev/thirdparty/recast/Detour/Include/DetourNavMesh.h index 286d3720..132c5600 100644 --- a/r5dev/thirdparty/recast/Detour/Include/DetourNavMesh.h +++ b/r5dev/thirdparty/recast/Detour/Include/DetourNavMesh.h @@ -318,7 +318,6 @@ struct dtMeshTile dtOffMeshConnection* offMeshCons; ///< The tile off-mesh connections. [Size: dtMeshHeader::offMeshConCount] unsigned char* data; ///< The tile data. (Not directly accessed under normal situations.) - void* meshLink; ///< Seems shifted with 8 bytes from here (the rest seems to line up with r2) see field assignments in 'r5apex.exe 0x140F44A00' int dataSize; ///< Size of the tile data. @@ -356,6 +355,7 @@ struct dtNavMeshParams int reachability_table_count = 0; }; +#pragma pack(push, 4) /// A navigation mesh based on tiles of convex polygons. /// @ingroup detour class dtNavMesh @@ -688,17 +688,18 @@ private: dtMeshTile** m_posLookup; ///< Tile hash lookup. dtMeshTile* m_nextFree; ///< Freelist of tiles. + + int unk0; ///< Unknown. dtMeshTile* m_tiles; ///< List of tiles. - - int nodePoolIdx; ///< Seems to be the node pool index? "[r5apex_ds.exe + 0xf4bfc0] e.g. 'dtNodePool::getNodeIdx(*&g_pdtNavMesh.unk0, node);'" #ifndef DT_POLYREF64 - unsigned int m_saltBits; ///< Number of salt bits in the tile ID. unsigned int m_tileBits; ///< Number of tile bits in the tile ID. unsigned int m_polyBits; ///< Number of poly bits in the tile ID. + int unk1 = -1; ///< Unknown. #endif friend class dtNavMeshQuery; }; +#pragma pack(pop) /// Allocates a navigation mesh object using the Detour allocator. /// @return A navigation mesh that is ready for initialization, or null on failure. diff --git a/r5dev/thirdparty/recast/Detour/Source/DetourNavMesh.cpp b/r5dev/thirdparty/recast/Detour/Source/DetourNavMesh.cpp index b01b4974..d85974c2 100644 --- a/r5dev/thirdparty/recast/Detour/Source/DetourNavMesh.cpp +++ b/r5dev/thirdparty/recast/Detour/Source/DetourNavMesh.cpp @@ -225,7 +225,7 @@ dtStatus dtNavMesh::init(const dtNavMeshParams* params) { memcpy(&m_params, params, sizeof(dtNavMeshParams)); dtVcopy(m_orig, params->orig); - nodePoolIdx = params->orig[1]; + unk0 = params->orig[2]; m_tileWidth = params->tileWidth; m_tileHeight = params->tileHeight;