- Remove obsolete var alpha
- Remove stat_weapons and use directly its value, it's used only once
- Make weapon_number local as it actually is
- Initialize weapon_damage and weapon_hit when and where they are used
- Remove acc_colors_debug
-#define MAX_ACCURACY_LEVELS 10 // including implict levels 0 and 100
+#define MAX_ACCURACY_LEVELS 10
float acc_lev[MAX_ACCURACY_LEVELS];
void HUD_WeaponIcons(void)
float acc_lev[MAX_ACCURACY_LEVELS];
void HUD_WeaponIcons(void)
float id = HUD_PANEL_WEAPONICONS;
HUD_Panel_UpdateCvarsForId(id);
float id = HUD_PANEL_WEAPONICONS;
HUD_Panel_UpdateCvarsForId(id);
- float alpha, stat_weapons; // "constants"
- float i, weapid, fade, weapon_stats, weapon_hit, weapon_damage, weapon_cnt; // variables
+ float i, weapid, fade, weapon_stats, weapon_number, weapon_cnt;
pos = panel_pos;
mySize = panel_size;
pos = panel_pos;
mySize = panel_size;
- stat_weapons = getstati(STAT_WEAPONS);
weapon_cnt = 0;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
weapon_cnt = 0;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
self = weaponorder[i];
weapid = self.impulse;
self = weaponorder[i];
weapid = self.impulse;
- alpha = (self.weapon == activeweapon) ? 1 : 0.6;
-
- weapon_hit = weapon_hits[self.weapon-WEP_FIRST];
- weapon_damage = weapon_fired[self.weapon-WEP_FIRST];
-
// draw background behind currently selected weapon
if(self.weapon == activeweapon)
drawpic_aspect_skin(wpnpos, "weapon_current_bg", wpnsize, '1 1 1', fade * panel_fg_alpha, DRAWFLAG_NORMAL);
// draw background behind currently selected weapon
if(self.weapon == activeweapon)
drawpic_aspect_skin(wpnpos, "weapon_current_bg", wpnsize, '1 1 1', fade * panel_fg_alpha, DRAWFLAG_NORMAL);
// draw the weapon accuracy
if(acc_levels)
{
// draw the weapon accuracy
if(acc_levels)
{
+ float weapon_hit, weapon_damage;
+ weapon_damage = weapon_fired[self.weapon-WEP_FIRST];
+ {
+ weapon_hit = weapon_hits[self.weapon-WEP_FIRST];
weapon_stats = floor(100 * weapon_hit / weapon_damage);
weapon_stats = floor(100 * weapon_hit / weapon_damage);
-
- if (cvar("acc_colors_debug") >= 0)
- weapon_stats = cvar("acc_colors_debug"); // TEST
// find the max level lower than weapon_stats
float j;
// find the max level lower than weapon_stats
float j;
}
// draw the weapon icon
}
// draw the weapon icon
- if((self.impulse >= 0) && (stat_weapons & self.weapons))
+ if((self.impulse >= 0) && (getstati(STAT_WEAPONS) & self.weapons))
{
drawpic_aspect_skin(wpnpos, strcat("weapon", self.netname), wpnsize, '1 1 1', fade * panel_fg_alpha, DRAWFLAG_NORMAL);
{
drawpic_aspect_skin(wpnpos, strcat("weapon", self.netname), wpnsize, '1 1 1', fade * panel_fg_alpha, DRAWFLAG_NORMAL);
float scoreboard_bottom;
float weapon_hits[WEP_MAXCOUNT];
float weapon_fired[WEP_MAXCOUNT];
float scoreboard_bottom;
float weapon_hits[WEP_MAXCOUNT];
float weapon_fired[WEP_MAXCOUNT];
float complain_weapon;
string complain_weapon_name;
float complain_weapon;
string complain_weapon_name;