From 78b8f2f9a9ada430306ab3cb8ad435b8a794f289 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 4 Sep 2011 18:48:59 +0200 Subject: [PATCH] clean up handling of active and switch weapon --- qcsrc/client/View.qc | 8 ++++---- qcsrc/client/hud.qc | 2 +- qcsrc/client/main.qh | 2 +- qcsrc/client/scoreboard.qc | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index b4c222a77..443c6c7fa 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -127,7 +127,7 @@ vector GetCurrentFov(float fov) zoomdir = button_zoom; if(hud == HUD_NORMAL) - if((getstati(STAT_ACTIVEWEAPON) == WEP_NEX && nex_scope) || (getstati(STAT_ACTIVEWEAPON) == WEP_RIFLE && rifle_scope)) // do NOT use switchweapon here + if((activeweapon == WEP_NEX && nex_scope) || (activeweapon == WEP_RIFLE && rifle_scope)) // do NOT use switchweapon here zoomdir += button_attack2; if(spectatee_status > 0 || isdemo()) { @@ -544,8 +544,8 @@ void CSQC_UpdateView(float w, float h) } ColorTranslateMode = autocvar_cl_stripcolorcodes; - activeswitchweapon = getstati(STAT_SWITCHWEAPON); - activeweapon = getstati(STAT_WEAPON); + switchweapon = getstati(STAT_SWITCHWEAPON); + activeweapon = getstati(STAT_ACTIVEWEAPON); f = (serverflags & SERVERFLAG_TEAMPLAY); if(f != teamplay) { @@ -1160,7 +1160,7 @@ void CSQC_UpdateView(float w, float h) f = autocvar_crosshair_effect_speed; if(f < 0) - f *= -2 * g_weaponswitchdelay; + f *= -1 * g_weaponswitchdelay; // anim starts when weapon has been lowered and new weapon comes up if(wcross_scale != wcross_scale_goal_prev || wcross_alpha != wcross_alpha_goal_prev || wcross_color != wcross_color_goal_prev) { wcross_changedonetime = time + f; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 88451ecce..92bbc5223 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -641,7 +641,7 @@ void HUD_Weapons(void) weapid = self.impulse; // draw background behind currently selected weapon - if(self.weapon == activeswitchweapon) + if(self.weapon == switchweapon) drawpic_aspect_skin(wpnpos, "weapon_current_bg", wpnsize, '1 1 1', wpnalpha, DRAWFLAG_NORMAL); // draw the weapon accuracy diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 91a5087d0..c9f23b93b 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -117,7 +117,7 @@ float spectatorbutton_zoom; float button_attack2; float activeweapon; -float activeswitchweapon; +float switchweapon; float current_viewzoom; float zoomin_effect; float warmup_stage; diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index 93f851876..2562ba005 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -978,7 +978,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) if(rows == 2) pos_x += weapon_width / 2; - if(getstati(STAT_SWITCHWEAPON) == WEP_MINSTANEX) + if(switchweapon == WEP_MINSTANEX) g_minstagib = 1; // TODO: real detection for minstagib? float weapon_stats; -- 2.39.2