}
}
- float i, weapid, wpnalpha, weapon_stats, weapon_number, weapon_cnt;
+ float i, weapid, wpnalpha, weapon_cnt;
weapon_cnt = 0;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
panel_size -= '2 2 0' * panel_bg_padding;
}
- // hits
- weapon_stats = getstati(STAT_DAMAGE_HITS);
- weapon_number = weapon_stats & 63;
- weapon_hits[weapon_number-WEP_FIRST] = floor(weapon_stats / 64);
- // fired
- weapon_stats = getstati(STAT_DAMAGE_FIRED);
- weapon_number = weapon_stats & 63;
- weapon_fired[weapon_number-WEP_FIRST] = floor(weapon_stats / 64);
-
if(cvar_or("hud_panel_weapons_fade", 1))
{
wpnalpha = 3.2 - 2 * (time - weapontime);
}
float show_accuracy;
+ float weapon_stats, weapon_number;
if(cvar("hud_panel_weapons_accuracy") && acc_levels)
{
+ show_accuracy = true;
+ // hits
+ weapon_stats = getstati(STAT_DAMAGE_HITS);
+ weapon_number = weapon_stats & 63;
+ weapon_hits[weapon_number-WEP_FIRST] = floor(weapon_stats / 64);
+ // fired
+ weapon_stats = getstati(STAT_DAMAGE_FIRED);
+ weapon_number = weapon_stats & 63;
+ weapon_fired[weapon_number-WEP_FIRST] = floor(weapon_stats / 64);
if (acc_col_x[0] == -1)
for (i = 0; i < acc_levels; ++i)
acc_col[i] = stov(cvar_string(strcat("hud_panel_weapons_accuracy_color", ftos(i))));
- show_accuracy = true;
}
float label = cvar("hud_panel_weapons_label");
if(getstati(STAT_SWITCHWEAPON) == WEP_MINSTANEX)
g_minstagib = 1; // TODO: real detection for minstagib?
+ float weapon_stats, weapon_number;
+ // hits
+ weapon_stats = getstati(STAT_DAMAGE_HITS);
+ weapon_number = weapon_stats & 63;
+ weapon_hits[weapon_number-WEP_FIRST] = floor(weapon_stats / 64);
+ // fired
+ weapon_stats = getstati(STAT_DAMAGE_FIRED);
+ weapon_number = weapon_stats & 63;
+ weapon_fired[weapon_number-WEP_FIRST] = floor(weapon_stats / 64);
+
if (!acc_levels)
rgb = '1 1 1';
else if (acc_col_x[0] == -1)
continue;
weapon_hit = weapon_hits[i-WEP_FIRST];
weapon_damage = weapon_fired[i-WEP_FIRST];
- if(weapon_damage)
- weapon_stats = bound(0, floor(100 * weapon_hit / weapon_damage), 100);
- float weapon_alpha;
+ float weapon_alpha;
if(weapon_damage)
+ {
+ weapon_stats = bound(0, floor(100 * weapon_hit / weapon_damage), 100);
weapon_alpha = scoreboard_alpha_fg;
+ }
else
weapon_alpha = 0.2 * scoreboard_alpha_fg;