aboutsummaryrefslogtreecommitdiff
path: root/primedev/engine/host.cpp
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2024-11-20 21:34:21 +0100
committerGitHub <noreply@github.com>2024-11-20 21:34:21 +0100
commitb9ecae0389d09be94eb3b53a98ddcaab9b74e702 (patch)
tree9648d03f52fdfbcef7a219afa8df88247cee3da6 /primedev/engine/host.cpp
parent04b7527fb0bdfce61d39c9d7de57f8c1e21ae660 (diff)
parent3e40fa3c9a589b7fc5088c43ead2b32bf68c6bbe (diff)
downloadNorthstarLauncher-b9ecae0389d09be94eb3b53a98ddcaab9b74e702.tar.gz
NorthstarLauncher-b9ecae0389d09be94eb3b53a98ddcaab9b74e702.zip
Merge branch 'main' into feat/whitelist-safeio-file-extensions
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);
}