From 96c34f64ab4ed6099d08f458178e4686dff96b00 Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Sun, 1 Sep 2024 18:44:04 +0100 Subject: Remove uses of Autohook from `gl_matsysiface.cpp` (#801) Removes AUTOHOOK macro from gl_matsysiface.cpp and replaces it with HookAttach --- primedev/engine/gl_matsysiface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'primedev') diff --git a/primedev/engine/gl_matsysiface.cpp b/primedev/engine/gl_matsysiface.cpp index 903a0113..075a56ac 100644 --- a/primedev/engine/gl_matsysiface.cpp +++ b/primedev/engine/gl_matsysiface.cpp @@ -2,9 +2,8 @@ CMaterialGlue* (*GetMaterialAtCrossHair)(); -AUTOHOOK_INIT() - -AUTOHOOK(CC_mat_crosshair_printmaterial_f, engine.dll + 0xB3C40, void, __fastcall, (const CCommand& args)) +static void(__fastcall* o_pCC_mat_crosshair_printmaterial_f)(const CCommand& args) = nullptr; +static void __fastcall h_CC_mat_crosshair_printmaterial_f(const CCommand& args) { CMaterialGlue* pMat = GetMaterialAtCrossHair(); @@ -44,7 +43,8 @@ AUTOHOOK(CC_mat_crosshair_printmaterial_f, engine.dll + 0xB3C40, void, __fastcal ON_DLL_LOAD("engine.dll", GlMatSysIFace, (CModule module)) { - AUTOHOOK_DISPATCH() + o_pCC_mat_crosshair_printmaterial_f = module.Offset(0xB3C40).RCast(); + HookAttach(&(PVOID&)o_pCC_mat_crosshair_printmaterial_f, (PVOID)h_CC_mat_crosshair_printmaterial_f); GetMaterialAtCrossHair = module.Offset(0xB37D0).RCast(); } -- cgit v1.2.3