]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/accuracy.qc
Reset weapon accuracy on readyrestart
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / accuracy.qc
index 2fe010f645c0c9a2c953df6c875cf50d0351c5c2..337ae54a98c86d4b889bb03da4b1cac0439116ee 100644 (file)
@@ -55,6 +55,21 @@ void accuracy_free(entity e)
        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)
 {