From 5321ee311e34b06266f5a22b6622683f404de135 Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Thu, 27 Jul 2023 21:39:01 +0200 Subject: [PATCH] Revert cv_chams settings Remove FRIEND_CHAMS and ENEMY_CHAMS, that way PLAYER_CHAMS always displays both teams --- src/cvars.c | 2 +- src/features/chams.c | 18 +++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/cvars.c b/src/cvars.c index cb3c2aa..07eea48 100644 --- a/src/cvars.c +++ b/src/cvars.c @@ -14,7 +14,7 @@ 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", "3"); + cv_chams = REGISTER_CVAR("chams", "1"); cv_crosshair = REGISTER_CVAR("crosshair", "0"); cv_clmove = REGISTER_CVAR("clmove", "0"); diff --git a/src/features/chams.c b/src/features/chams.c index d334016..fe477fe 100644 --- a/src/features/chams.c +++ b/src/features/chams.c @@ -8,13 +8,10 @@ enum chams_settings { DISABLED = 0, - ENEMY_CHAMS = 1, - FRIEND_CHAMS = 2, - /* ALL_PLAYER is 3, but we can OR player and hands */ - HAND_CHAMS = 4, - /* ALL is 5, but we will convert it to 7 so every setting can be OR'd */ + PLAYER_CHAMS = 1, + HAND_CHAMS = 2, + /* ALL is 3, but we can OR player and hands */ }; - visible_flags visible_mode; bool chams(void* this_ptr) { @@ -34,19 +31,14 @@ bool chams(void* this_ptr) { visible_mode = NONE; /* Reset for future calls */ glEnable(GL_TEXTURE_2D); return true; - } else if (!valid_player(ent) || !is_alive(ent)) { + } else if (!(setting & PLAYER_CHAMS) || !valid_player(ent) || + !is_alive(ent)) { /* If we don't want player chams, or this is not a player, stop */ return false; } const bool friendly = is_friend(ent); - /* Friendly ent but we dont want to render friends OR - * Not friendly ent and we dont want to render enemies*/ - if ((friendly && !(setting & FRIEND_CHAMS)) || - (!friendly && !(setting & ENEMY_CHAMS))) - return false; - /* If we got here it means we are rendering a valid player */ glDisable(GL_TEXTURE_2D);