From 56217cc7f379a3dbda3a8e176ec1dbd8ea898acd Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Tue, 25 Jul 2023 22:10:26 +0200 Subject: [PATCH] Add cv_clmove cvar --- src/cvars.c | 4 ++++ src/hooks.c | 9 ++++++++- src/include/cvars.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/cvars.c b/src/cvars.c index c3d0a1d..e4c5ac6 100644 --- a/src/cvars.c +++ b/src/cvars.c @@ -8,11 +8,15 @@ DECL_CVAR(autostrafe); DECL_CVAR(esp); DECL_CVAR(chams); +DECL_CVAR(clmove); + bool cvars_init(void) { cv_bhop = REGISTER_CVAR("bhop", "1"); cv_autostrafe = REGISTER_CVAR("autostrafe", "0"); cv_esp = REGISTER_CVAR("esp", "3"); cv_chams = REGISTER_CVAR("chams", "1"); + cv_clmove = REGISTER_CVAR("clmove", "0"); + return true; } diff --git a/src/hooks.c b/src/hooks.c index 85e0a7c..7a9274f 100644 --- a/src/hooks.c +++ b/src/hooks.c @@ -5,6 +5,9 @@ #include "include/util.h" #include "include/detour.h" /* 8dcc/detour-lib */ +/* DELME */ +#include "include/cvars.h" + /* bhop(), esp(), etc. */ #include "features/features.h" @@ -117,6 +120,10 @@ void h_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) { /*----------------------------------------------------------------------------*/ void h_CL_Move() { - /* printf("Hello from CL_Move!\n"); */ + if (cv_clmove->value != 0) { + for (int i = 0; i < (int)cv_clmove->value; i++) + CALL_ORIGINAL(clmove_data, clmove); + } + CALL_ORIGINAL(clmove_data, clmove); } diff --git a/src/include/cvars.h b/src/include/cvars.h index f9c1855..64e98d7 100644 --- a/src/include/cvars.h +++ b/src/include/cvars.h @@ -34,6 +34,8 @@ DECL_CVAR_EXTERN(autostrafe); DECL_CVAR_EXTERN(esp); DECL_CVAR_EXTERN(chams); +DECL_CVAR_EXTERN(clmove); + /*----------------------------------------------------------------------------*/ bool cvars_init(void);