mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
The reachability table needs to be figured out still. The issue should be very small, but at the moment I do not have time for it. The pointer to the table, and table pointers to data is correct, however, not a single poly is ever getting marked as 'reachable' (0xffffffff). This could be either within recast itself (see build_link_table() and set_reachable() functions), or the way the engine parses the data. The function that determines whether poly is reachable is located at '0x140F448E0'
34 lines
2.4 KiB
C++
34 lines
2.4 KiB
C++
#pragma once
|
|
#include "thirdparty/recast/detour/include/detourstatus.h"
|
|
#include "thirdparty/recast/detour/include/detournavmesh.h"
|
|
|
|
namespace
|
|
{
|
|
//-------------------------------------------------------------------------
|
|
// RUNTIME: DETOUR
|
|
//-------------------------------------------------------------------------
|
|
ADDRESS p_dtNavMesh__Init = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x4C\x89\x44\x24\x00\x53\x41\x56\x48\x81\xEC\x00\x00\x00\x00\x0F\x10\x11", "xxxx?xxxxxx????xxx");
|
|
dtStatus (*dtNavMesh__Init)(dtNavMesh* thisptr, unsigned char* data, int flags) = (dtStatus(*)(dtNavMesh*, unsigned char*, int))p_dtNavMesh__Init.GetPtr(); /*4C 89 44 24 ? 53 41 56 48 81 EC ? ? ? ? 0F 10 11*/
|
|
|
|
ADDRESS p_dtNavMesh__addTile = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x44\x89\x4C\x24\x00\x41\x55", "xxxx?xx");/*44 89 4C 24 ? 41 55*/
|
|
dtStatus(*dtNavMesh__addTile)(dtNavMesh* thisptr, unsigned char* data, dtMeshHeader* header, int datasize, int flags, dtTileRef lastRef) = (dtStatus(*)(dtNavMesh*, unsigned char*, dtMeshHeader*, int, int, dtTileRef))p_dtNavMesh__addTile.GetPtr();
|
|
|
|
ADDRESS p_dtNavMesh__isPolyReachable = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x41\x56\x49\x63\xF1", "xxxx?xxxx?xxxx?xxxxx"); /*48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 49 63 F1*/
|
|
bool(*dtNavMesh__isPolyReachable)(dtNavMesh* thisptr, dtPolyRef poly_1, dtPolyRef poly_2, int hull_type) = (bool(*)(dtNavMesh*, dtPolyRef, dtPolyRef, int))p_dtNavMesh__isPolyReachable.GetPtr();
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
class HRecast : public IDetour
|
|
{
|
|
virtual void debugp()
|
|
{
|
|
std::cout << "| FUN: dtNavMesh::Init : 0x" << std::hex << std::uppercase << p_dtNavMesh__Init.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
std::cout << "| FUN: dtNavMesh::addTile : 0x" << std::hex << std::uppercase << p_dtNavMesh__addTile.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
std::cout << "| FUN: dtNavMesh::isPolyReachable : 0x" << std::hex << std::uppercase << p_dtNavMesh__isPolyReachable.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
|
}
|
|
};
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
REGISTER(HRecast);
|