diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2024-09-20 14:24:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-20 14:24:56 +0200 |
commit | a4b09bc42d5f79ef86697c893efc9e3b7d966502 (patch) | |
tree | d4c7b2b8cc04361ddf7b9c942e5f9462bb55e0b9 /primedev/engine/host.cpp | |
parent | a9d2ce8a692f7890f4e4bfc21458332890605a5f (diff) | |
parent | 6737a344c012c0f7fd19cd593949dd3dbe5a0cb7 (diff) | |
download | NorthstarLauncher-a4b09bc42d5f79ef86697c893efc9e3b7d966502.tar.gz NorthstarLauncher-a4b09bc42d5f79ef86697c893efc9e3b7d966502.zip |
Merge branch 'main' into feat/overhaul-mod-loading-locationsfeat/overhaul-mod-loading-locations
Diffstat (limited to 'primedev/engine/host.cpp')
-rw-r--r-- | primedev/engine/host.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/primedev/engine/host.cpp b/primedev/engine/host.cpp index dacb8fc1..e414908b 100644 --- a/primedev/engine/host.cpp +++ b/primedev/engine/host.cpp @@ -6,15 +6,11 @@ #include "r2engine.h" #include "core/tier0.h" -AUTOHOOK_INIT() - -// clang-format off -AUTOHOOK(Host_Init, engine.dll + 0x155EA0, -void, __fastcall, (bool bDedicated)) -// clang-format on +static void(__fastcall* o_pHost_Init)(bool bDedicated) = nullptr; +static void __fastcall h_Host_Init(bool bDedicated) { spdlog::info("Host_Init()"); - Host_Init(bDedicated); + o_pHost_Init(bDedicated); FixupCvarFlags(); // need to initialise these after host_init since they do stuff to preexisting concommands/convars without being client/server specific InitialiseCommandPrint(); @@ -29,5 +25,6 @@ void, __fastcall, (bool bDedicated)) ON_DLL_LOAD("engine.dll", Host_Init, (CModule module)) { - AUTOHOOK_DISPATCH() + o_pHost_Init = module.Offset(0x155EA0).RCast<decltype(o_pHost_Init)>(); + HookAttach(&(PVOID&)o_pHost_Init, (PVOID)h_Host_Init); } |