From 21d9cac26464de60158bfe90091c27a50400d5ea Mon Sep 17 00:00:00 2001 From: Wizzard <25581244+Wizzard@users.noreply.toomuchslop.com> Date: Thu, 21 Sep 2023 12:33:22 -0400 Subject: [PATCH] Added invisible character & added 'dz_misc_namechanger_speed' --- src/cvars.c | 2 ++ src/features/namechanger.c | 4 ++-- src/include/cvars.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cvars.c b/src/cvars.c index 7d12d86..2c4f864 100644 --- a/src/cvars.c +++ b/src/cvars.c @@ -21,6 +21,7 @@ DECL_CVAR(movement_antiaim); DECL_CVAR(movement_antiaim_view); DECL_CVAR(movement_fakeduck); DECL_CVAR(misc_namechanger); +DECL_CVAR(misc_namechanger_speed); bool cvars_init(void) { @@ -40,6 +41,7 @@ bool cvars_init(void) { REGISTER_CVAR(movement_antiaim_view, 0); REGISTER_CVAR(movement_fakeduck, 0); REGISTER_CVAR(misc_namechanger, 0); + REGISTER_CVAR(misc_namechanger_speed, 10); if (IsCS16()) { REGISTER_CVAR(visuals_tracers, 0); } else { diff --git a/src/features/namechanger.c b/src/features/namechanger.c index f9e7eaf..022b93e 100644 --- a/src/features/namechanger.c +++ b/src/features/namechanger.c @@ -17,7 +17,7 @@ void change_name(const char* new_name) { if (!new_name) return; char command[256]; - snprintf(command, sizeof(command), "name \"%s\u200B\"", new_name); + snprintf(command, sizeof(command), "name \"%s\u0315 \"", new_name); i_engine->pfnClientCmd(command); } @@ -72,7 +72,7 @@ void change_name_all_players() { void change_name_based_on_mode(usercmd_t* cmd) { if (!CVAR_ON(misc_namechanger)) return; - if (++change_counter < NAME_CHANGE_INTERVAL) { + if (++change_counter < dz_misc_namechanger_speed->value) { return; } change_counter = 0; diff --git a/src/include/cvars.h b/src/include/cvars.h index 03de83d..f46f42c 100644 --- a/src/include/cvars.h +++ b/src/include/cvars.h @@ -47,6 +47,7 @@ DECL_CVAR_EXTERN(movement_antiaim); DECL_CVAR_EXTERN(movement_antiaim_view); DECL_CVAR_EXTERN(movement_fakeduck); DECL_CVAR_EXTERN(misc_namechanger) +DECL_CVAR_EXTERN(misc_namechanger_speed) /*----------------------------------------------------------------------------*/