float average_accuracy;
vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
{
+ WepSet weapons_stat = WepSet_GetFromStat();
+ WepSet weapons_inmap = WepSet_GetFromStat_InMap();
int i;
- int weapon_cnt = WEP_COUNT - 3; // either vaporizer/vortex are hidden, no port-o-launch, no tuba
- float rows;
+ float weapon_stats;
+ int disownedcnt = 0;
+ for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+ {
+ self = get_weaponinfo(i);
+ if(!self.weapon)
+ continue;
+
+ weapon_stats = weapon_accuracy[i-WEP_FIRST];
+
+ if(weapon_stats < 0 && !(weapons_stat & WepSet_FromWeapon(i) || weapons_inmap & WepSet_FromWeapon(i)))
+ ++disownedcnt;
+ }
+
+ int weapon_cnt = WEP_COUNT - disownedcnt;
+ int rows;
if(autocvar_scoreboard_accuracy_doublerows)
rows = 2;
else
if(switchweapon == WEP_VAPORIZER)
g_instagib = 1; // TODO: real detection for instagib?
- float weapon_stats;
if(autocvar_scoreboard_accuracy_nocolors)
rgb = '1 1 1';
else
self = get_weaponinfo(i);
if (!self.weapon)
continue;
- if ((i == WEP_VORTEX && g_instagib) || i == WEP_PORTO || (i == WEP_VAPORIZER && !g_instagib) || i == WEP_TUBA) // skip port-o-launch, vortex || vaporizer and tuba
- continue;
weapon_stats = weapon_accuracy[i-WEP_FIRST];
+ if(weapon_stats < 0 && !(weapons_stat & WepSet_FromWeapon(i) || weapons_inmap & WepSet_FromWeapon(i)))
+ continue;
+
float weapon_alpha;
if(weapon_stats >= 0)
weapon_alpha = scoreboard_alpha_fg;
const int STAT_OK_AMMO_CHARGEPOOL = 86;
const int STAT_FROZEN = 87;
const int STAT_REVIVE_PROGRESS = 88;
-// 89 empty?
-// 90 empty?
-// 91 empty?
+const int STAT_WEAPONSINMAP = 89;
+const int STAT_WEAPONSINMAP2 = 90;
+const int STAT_WEAPONSINMAP3 = 91;
// 92 empty?
// 93 empty?
// 94 empty?
#endif
#endif
}
+void WepSet_AddStat_InMap()
+{
+ addstat(STAT_WEAPONSINMAP, AS_INT, weaponsinmap_x);
+#if WEP_MAXCOUNT > 24
+ addstat(STAT_WEAPONSINMAP2, AS_INT, weaponsinmap_y);
+#if WEP_MAXCOUNT > 48
+ addstat(STAT_WEAPONSINMAP3, AS_INT, weaponsinmap_z);
+#endif
+#endif
+}
void WriteWepSet(float dst, WepSet w)
{
#if WEP_MAXCOUNT > 48
#endif
return w;
}
+WepSet WepSet_GetFromStat_InMap()
+{
+ WepSet w = '0 0 0';
+ w_x = getstati(STAT_WEAPONSINMAP);
+#if WEP_MAXCOUNT > 24
+ w_y = getstati(STAT_WEAPONSINMAP2);
+#if WEP_MAXCOUNT > 48
+ w_z = getstati(STAT_WEAPONSINMAP3);
+#endif
+#endif
+ return w;
+}
WepSet ReadWepSet()
{
#if WEP_MAXCOUNT > 48
WepSet WepSet_FromWeapon(int a);
#ifdef SVQC
void WepSet_AddStat();
+void WepSet_AddStat_InMap();
void WriteWepSet(float dest, WepSet w);
#endif
#ifdef CSQC
WepSet WepSet_GetFromStat();
+WepSet WepSet_GetFromStat_InMap();
WepSet ReadWepSet();
#endif
self.stat_allow_oldvortexbeam = autocvar_g_allow_oldvortexbeam;
self.stat_leadlimit = autocvar_leadlimit;
+ self.weaponsinmap = weaponsInMap;
+
if(frametime)
{
// physics frames: update anticheat stuff
// WEAPONTODO: remove this
WepSet weaponsInMap;
+.WepSet weaponsinmap;
+
.float respawn_countdown; // next number to count
float bot_waypoints_for_items;
WeaponStats_Init();
WepSet_AddStat();
+ WepSet_AddStat_InMap();
addstat(STAT_SWITCHWEAPON, AS_INT, switchweapon);
addstat(STAT_SWITCHINGWEAPON, AS_INT, switchingweapon);
addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime);