From 2141daae2752f907f23d16f4a2378440e1f18de1 Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Sun, 23 Jul 2023 15:38:43 +0200 Subject: [PATCH] Add autostrafe cvar --- src/cvars.c | 6 ++++-- src/include/cvars.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cvars.c b/src/cvars.c index b2b0db5..2f06943 100644 --- a/src/cvars.c +++ b/src/cvars.c @@ -4,11 +4,13 @@ #include "include/globals.h" DECL_CVAR(bhop); +DECL_CVAR(autostrafe); DECL_CVAR(esp); bool cvars_init(void) { - cv_bhop = REGISTER_CVAR("bhop", "1"); - cv_esp = REGISTER_CVAR("esp", "0"); + cv_bhop = REGISTER_CVAR("bhop", "1"); + cv_autostrafe = REGISTER_CVAR("autostrafe", "0"); + cv_esp = REGISTER_CVAR("esp", "0"); return true; } diff --git a/src/include/cvars.h b/src/include/cvars.h index 7486c91..0bc2ac1 100644 --- a/src/include/cvars.h +++ b/src/include/cvars.h @@ -25,11 +25,12 @@ #define REGISTER_CVAR(name, value) \ i_engine->pfnRegisterVariable(CVAR_PREFIX name, value, CVAR_HACK_ID); -#define CVAR_ON(name) (cv_##name->value != 0) +#define CVAR_ON(name) (cv_##name->value != 0.0f) /*----------------------------------------------------------------------------*/ DECL_CVAR_EXTERN(bhop); +DECL_CVAR_EXTERN(autostrafe); DECL_CVAR_EXTERN(esp); /*----------------------------------------------------------------------------*/