r5sdk/r5dev/tier0/jobthread.cpp
Kawe Mazidjatari edc52ad669 IDetour: remove extraneous pointer assignments
Originally, we store the search results in a CMemory instance which we then assign to the actual function pointer. CMemory is just a pointer class; we can assign the results directly to the actual function pointer. This commit reduces a lot of code verbosity, and also reduced roughly 2KiB worth of static pointers in the resulting executable. This commit also officially deprecates the support for any GameDLL's below S3 (Season 3), since it makes more sense to port the assets from earlier/later games back to the version this SDK supports.
2024-04-05 17:19:32 +02:00

29 lines
974 B
C++

#include "engine/host_cmd.h"
#include "tier0/jobthread.h"
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void* HJT_HelpWithAnything(bool bShouldLoadPak)
{
// !! Uncomment if needed !!
// !! Consider initializing this in idetour iface if enabled !!
//static void* const retaddr = g_GameDll.FindPatternSIMD("48 8B C4 ?? 41 54 41 55 48 81 EC 70 04 ?? ?? F2 0F 10 05 ?? ?? ?? 0B")
// .Offset(0x4A0).FindPatternSelf("48 8B ?? ?? ?? ?? 01", CMemory::Direction::DOWN).RCast<void*>();
void* const results = JT_HelpWithAnything(bShouldLoadPak);
//if (retaddr != _ReturnAddress()) // Check if this is called after 'PakFile_Init()'.
//{
// return results;
//}
// Do stuff here after 'PakFile_Init()'.
return results;
}
void VJobThread::Detour(const bool bAttach) const
{
//DetourSetup(&JT_HelpWithAnything, &HJT_HelpWithAnything, bAttach);
}