]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/accuracy.qc
fix some coloring bugs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / accuracy.qc
index c2a68d723eb0081e4d1e0464d315b69b1f1e6942..4d63fd82002dcb9ea176cfabdedd43f3d4bd5db1 100644 (file)
@@ -6,9 +6,12 @@ FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(accuracy_fired);
 
 float accuracy_byte(float n, float d)
 {
-       if(d == 0)
+       //print(sprintf("accuracy: %d / %d\n", n, d));
+       if(n <= 0)
                return 0;
-       return 1.0 + rint(n * 254.0 / d);
+       if(n > d)
+               return 255;
+       return 1 + rint(n * 100.0 / d);
 }
 
 float accuracy_send(entity to, float sf)
@@ -60,7 +63,7 @@ void accuracy_resend(entity e)
 }
 
 // update accuracy stats
-void accuracy_set(entity e, float w, float hit, float fired)
+void accuracy_set(entity e, float w, float fired, float hit)
 {
        entity a;
        float b;
@@ -81,7 +84,7 @@ void accuracy_set(entity e, float w, float hit, float fired)
                                a.SendFlags |= w;
 }
 
-void accuracy_add(entity e, float w, float hit, float fired)
+void accuracy_add(entity e, float w, float fired, float hit)
 {
        entity a;
        float b;