game_starttime = time + RESTART_COUNTDOWN;
// clear player attributes
- FOREACH_CLIENT(IS_PLAYER(it), {
+ FOREACH_CLIENT(true, {
+ accuracy_reset(it);
+ if (!IS_PLAYER(it))
+ continue;
it.alivetime = 0;
CS(it).killcount = 0;
float val = PlayerStats_GameReport_Event_Player(it, PLAYERSTATS_ALIVETIME, 0);
delete(CS(e).accuracy);
}
+void accuracy_reset(entity e)
+{
+ entity a = CS(e).accuracy;
+ if (!a) return;
+
+ for (int i = 0; i < REGISTRY_MAX(Weapons); i++)
+ {
+ a.accuracy_frags[i] = 0;
+ a.accuracy_hit[i] = 0;
+ a.accuracy_fired[i] = 0;
+ a.accuracy_cnt_hit[i] = 0;
+ a.accuracy_cnt_fired[i] = 0;
+ }
+}
+
// force a resend of a player's accuracy stats
void accuracy_resend(entity e)
{
void accuracy_init(entity e);
void accuracy_free(entity e);
+void accuracy_reset(entity e);
+
// force a resend of a player's accuracy stats
void accuracy_resend(entity e);