From fe0333a5aa9ac6ee0d0da589553101b9472680d6 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 4 Mar 2012 18:47:46 +0100 Subject: [PATCH] now CSQC _should_ be fine too --- qcsrc/client/hud.qc | 15 ++++++++------- qcsrc/client/scoreboard.qc | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index bf8785a49..0223d07df 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -432,7 +432,8 @@ float GetAmmoTypeForWep(float i) void HUD_Weapons(void) { // declarations - float weapons_stat = getstati(STAT_WEAPONS); + WEPSET_DECLARE_A(weapons_stat); + WEPSET_COPY_AS(weapons_stat); float i, f, a, j, factor; float screen_ar, center_x, center_y; float weapon_count, weapon_id, weapon_alpha; @@ -519,9 +520,9 @@ void HUD_Weapons(void) { if(autocvar__hud_configure) { - if (weapons_stat == 0) // create some fake weapons anyway - for(i = 0; i <= WEP_LAST-WEP_FIRST; i += floor((WEP_LAST-WEP_FIRST)/5)) - weapons_stat |= power2of(i); + if (WEPSET_EMPTY_A(weapons_stat)) + for(i = WEP_FIRST; i <= WEP_LAST; i += floor((WEP_LAST-WEP_FIRST)/5)) + WEPSET_OR_AW(weapons_stat, i); if(menu_enabled != 2) HUD_Panel_DrawBg(1); // also draw the bg of the entire panel @@ -529,7 +530,7 @@ void HUD_Weapons(void) // do we own this weapon? for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i) - if(weapons_stat & weaponorder[i].weapons) + if(WEPSET_CONTAINS_AW(weapons_stat, weaponorder[i].weapon)) ++weapon_count; // add it anyway if weaponcomplain is shown @@ -678,7 +679,7 @@ void HUD_Weapons(void) // skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon if (autocvar_hud_panel_weapons_onlyowned - && !((weapons_stat & self.weapons) + && !(WEPSET_CONTAINS_AW(weapons_stat, self.weapon) || (self.weapon == complain_weapon && time - complain_weapon_time < when + fadetime && autocvar_hud_panel_weapons_complainbubble))) @@ -714,7 +715,7 @@ void HUD_Weapons(void) } // drawing all the weapon items - if(weapons_stat & self.weapons) + if(WEPSET_CONTAINS_AW(weapons_stat, self.weapon)) { // draw the weapon image drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL); diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index e828a17d5..935a0277a 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -992,7 +992,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) for(i = WEP_FIRST; i <= WEP_LAST; ++i) { self = get_weaponinfo(i); - if not(self.weapons) + if not(self.weapon) continue; if ((i == WEP_NEX && g_minstagib) || i == WEP_PORTO || (i == WEP_MINSTANEX && !g_minstagib) || i == WEP_TUBA) // skip port-o-launch, nex || minstanex and tuba continue; -- 2.39.2