]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Some more maths to tighten
authorMario <mario@smbclan.net>
Mon, 6 Mar 2017 23:25:00 +0000 (09:25 +1000)
committerMario <mario@smbclan.net>
Mon, 6 Mar 2017 23:25:00 +0000 (09:25 +1000)
qcsrc/lib/math.qh

index de6cb95c37c4e9b971c0b2e350cea712adee9b54..06994887c58ad6bbaeb7a46855052f300561279b 100644 (file)
@@ -193,8 +193,8 @@ float almost_in_bounds(float a, float b, float c)
 
 float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float d)
 {
-       if (halflifedist > 0) return (0.5 ** (bound(mindist, d, maxdist) - mindist) / halflifedist);
-       else if (halflifedist < 0) return (0.5 ** (bound(mindist, d, maxdist) - maxdist) / halflifedist);
+       if (halflifedist > 0) return (0.5 ** ((bound(mindist, d, maxdist) - mindist) / halflifedist));
+       else if (halflifedist < 0) return (0.5 ** ((bound(mindist, d, maxdist) - maxdist) / halflifedist));
        else return 1;
 }