From 464be8120419790eb49ec9392f2ba3ef6ef41d84 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Tue, 14 May 2013 03:57:13 -0400 Subject: [PATCH] Strip out old g_balance_weaponswitchdelay cvar usage --- crosshairs.cfg | 2 +- qcsrc/client/Main.qc | 2 -- qcsrc/client/View.qc | 8 +++----- qcsrc/client/autocvars.qh | 2 +- qcsrc/client/main.qh | 1 - qcsrc/server/autocvars.qh | 3 --- qcsrc/server/cl_client.qc | 6 ------ 7 files changed, 5 insertions(+), 19 deletions(-) diff --git a/crosshairs.cfg b/crosshairs.cfg index e37584bdf..e02e7c2e2 100644 --- a/crosshairs.cfg +++ b/crosshairs.cfg @@ -17,7 +17,7 @@ seta crosshair_dot_color "1 0 0" seta crosshair_dot_color_custom 1 "use a custom color for the crosshair dot" // smooth transitions for crosshair changes -seta crosshair_effect_speed -1 "how fast (in seconds) some crosshair effects should take place, 0 = instant, -1 = 2x weapon switch time" +seta crosshair_effect_time 0.4 "how fast (in seconds) some crosshair effects should take place, 0 = instant" seta crosshair_effect_scalefade 1 "use scaling and fading for crosshair effects" // item pickup animation settings diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index f60ad9765..edb4105ee 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -1020,8 +1020,6 @@ void Ent_Init() armorblockpercent = ReadByte() / 255.0; - g_weaponswitchdelay = ReadByte() / 255.0; - g_balance_grenadelauncher_bouncefactor = ReadCoord(); g_balance_grenadelauncher_bouncestop = ReadCoord(); g_balance_electro_secondary_bouncefactor = ReadCoord(); diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index b2e9c03e0..08c247f4e 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -1294,9 +1294,7 @@ void CSQC_UpdateView(float w, float h) if(shottype == SHOTTYPE_HITTEAM) wcross_scale /= autocvar_crosshair_hittest; // is not queried if hittest is 0 - f = autocvar_crosshair_effect_speed; - if(f < 0) - f *= -2 * g_weaponswitchdelay; // anim starts when weapon has been lowered and new weapon comes up + f = fabs(autocvar_crosshair_effect_time); if(wcross_scale != wcross_scale_goal_prev || wcross_alpha != wcross_alpha_goal_prev || wcross_color != wcross_color_goal_prev) { wcross_changedonetime = time + f; @@ -1420,9 +1418,9 @@ void CSQC_UpdateView(float w, float h) } // if in weapon switch animation, fade ring out/in - if(g_weaponswitchdelay > 0) + if(fabs(autocvar_crosshair_effect_time) > 0) { - f = (time - wcross_name_changestarttime) / g_weaponswitchdelay; + f = (time - wcross_name_changestarttime) / wcross_changedonetime; if(f > 0 && f < 2) ring_alpha *= fabs(1 - f); } diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 16714460b..af7008150 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -105,7 +105,7 @@ string autocvar_crosshair_dot_color; var float autocvar_crosshair_dot_color_custom = 1; float autocvar_crosshair_dot_size; float autocvar_crosshair_effect_scalefade; -float autocvar_crosshair_effect_speed; +var float autocvar_crosshair_effect_time = 0.2; var float autocvar_crosshair_enabled = 1; float autocvar_crosshair_hitindication; string autocvar_crosshair_hitindication_color; diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 8369a5ff2..10a3b165c 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -127,7 +127,6 @@ void centerprint_generic(float new_id, string strMessage, float duration, float #define ALPHA_MIN_VISIBLE 0.003 float armorblockpercent; -float g_weaponswitchdelay; //hooks float calledhooks; diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index fe96bc035..e6a242a70 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -509,8 +509,6 @@ float autocvar_g_balance_nex_secondary_damagefalloff_maxdist; float autocvar_g_balance_nex_secondary_damagefalloff_mindist; float autocvar_g_balance_nex_secondary_force; float autocvar_g_balance_nex_secondary_refire; -noref float autocvar_g_balance_nex_switchdelay_drop; -noref float autocvar_g_balance_nex_switchdelay_raise; float autocvar_g_balance_nex_reload_ammo; float autocvar_g_balance_nex_reload_time; float autocvar_g_balance_nexball_primary_animtime; @@ -690,7 +688,6 @@ float autocvar_g_balance_uzi_sustained_refire; float autocvar_g_balance_uzi_sustained_spread; float autocvar_g_balance_uzi_reload_ammo; float autocvar_g_balance_uzi_reload_time; -float autocvar_g_balance_weaponswitchdelay; float autocvar_g_ballistics_density_corpse; float autocvar_g_ballistics_density_player; float autocvar_g_ballistics_materialconstant; diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 9239a8292..e3731943f 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -629,7 +629,6 @@ float ClientInit_SendEntity(entity to, float sf) else WriteString(MSG_ENTITY, ""); WriteByte(MSG_ENTITY, self.count * 255.0); // g_balance_armor_blockpercent - WriteByte(MSG_ENTITY, self.cnt * 255.0); // g_balance_weaponswitchdelay WriteCoord(MSG_ENTITY, self.bouncefactor); // g_balance_grenadelauncher_bouncefactor WriteCoord(MSG_ENTITY, self.bouncestop); // g_balance_grenadelauncher_bouncestop WriteCoord(MSG_ENTITY, self.ebouncefactor); // g_balance_grenadelauncher_bouncefactor @@ -652,11 +651,6 @@ void ClientInit_CheckUpdate() self.count = autocvar_g_balance_armor_blockpercent; self.SendFlags |= 1; } - if(self.cnt != autocvar_g_balance_weaponswitchdelay) - { - self.cnt = autocvar_g_balance_weaponswitchdelay; - self.SendFlags |= 1; - } if(self.bouncefactor != autocvar_g_balance_grenadelauncher_bouncefactor) { self.bouncefactor = autocvar_g_balance_grenadelauncher_bouncefactor; -- 2.39.2