if(hit)
a.(accuracy_cnt_hit[w]) = 1;
- a.(accuracy_cnt_fired[w]) = 1;
+ a.(accuracy_cnt_fired[w]) = 1;
if(b == accuracy_byte(hit, fired))
return;
a.SendFlags |= w;
}
+.float hit_time;
+.float fired_time;
+
void accuracy_add(entity e, float w, float fired, float hit)
{
entity a;
if(fired)
a.(accuracy_fired[w]) += fired;
- if(hit)
+ if(hit && a.hit_time != time) // only run this once per frame
+ {
a.(accuracy_cnt_hit[w]) += 1;
- a.(accuracy_cnt_fired[w]) += 1;
+ a.hit_time = time;
+ }
+
+ if(fired && a.fired_time != time) // only run this once per frame
+ {
+ a.(accuracy_cnt_fired[w]) += 1;
+ a.fired_time = time;
+ }
if(b == accuracy_byte(a.(accuracy_hit[w]), a.(accuracy_fired[w])))
return;