diff --git a/primedev/engine/runframe.cpp b/primedev/engine/runframe.cpp index ddfd92534..bfec9b8f6 100644 --- a/primedev/engine/runframe.cpp +++ b/primedev/engine/runframe.cpp @@ -3,17 +3,14 @@ #include "hoststate.h" #include "server/serverpresence.h" -AUTOHOOK_INIT() - -// clang-format off -AUTOHOOK(CEngine__Frame, engine.dll + 0x1C8650, -void, __fastcall, (CEngine* self)) -// clang-format on +static void(__fastcall* o_pCEngine__Frame)(CEngine* self) = nullptr; +static void __fastcall h_CEngine__Frame(CEngine* self) { - CEngine__Frame(self); + o_pCEngine__Frame(self); } ON_DLL_LOAD("engine.dll", RunFrame, (CModule module)) { - AUTOHOOK_DISPATCH() + o_pCEngine__Frame = module.Offset(0x1C8650).RCast(); + HookAttach(&(PVOID&)o_pCEngine__Frame, (PVOID)h_CEngine__Frame); }