From b7711d2503725b27dfc715a59c1bc01649c78aa1 Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Thu, 20 Jul 2023 17:44:04 +0200 Subject: [PATCH] Add hooks source With hooks_init for hooking everything and CL_CreateMove hook --- src/hooks.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/hooks.c diff --git a/src/hooks.c b/src/hooks.c new file mode 100644 index 0000000..f95e2cc --- /dev/null +++ b/src/hooks.c @@ -0,0 +1,18 @@ + +#include "include/hooks.h" +#include "include/sdk.h" +#include "include/globals.h" + +DECL_HOOK(CL_CreateMove); + +bool hooks_init(void) { + HOOK(gp_client, CL_CreateMove); + + return true; +} + +void h_CL_CreateMove(float frametime, usercmd_t* cmd, int active) { + /* printf("Hello from CL_CreateMove!\n"); */ + + ORIGINAL(CL_CreateMove, frametime, cmd, active); +}