]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util.qc
Merge branch 'divVerent/ru'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util.qc
index 23354397aacfd044f30d1ea744d64211fc1cd922..582777647c9fcd2e2798baa4c695ecea269d3969 100644 (file)
@@ -196,6 +196,9 @@ float median(float a, float b, float c)
 // works for up to 10 decimals!
 string ftos_decimals(float number, float decimals)
 {
+       // inhibit stupid negative zero
+       if(number == 0)
+               number = 0;
        // we have sprintf...
        return sprintf("%.*f", decimals, number);
 }
@@ -909,6 +912,8 @@ float almost_in_bounds(float a, float b, float c)
 {
        float eps;
        eps = (max(a, -a) + max(c, -c)) * 0.001;
+       if(a > c)
+               eps = -eps;
        return b == median(a - eps, b, c + eps);
 }