aboutsummaryrefslogtreecommitdiff
path: root/primedev/engine/host.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'primedev/engine/host.cpp')
-rw-r--r--primedev/engine/host.cpp13
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);
}