From: Mario Date: Mon, 6 Mar 2017 23:25:00 +0000 (+1000) Subject: Some more maths to tighten X-Git-Tag: xonotic-v0.8.2~119 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d7383a91932d8eedc776411c4c0a1cac65428e83;p=xonotic%2Fxonotic-data.pk3dir.git Some more maths to tighten --- diff --git a/qcsrc/lib/math.qh b/qcsrc/lib/math.qh index de6cb95c3..06994887c 100644 --- a/qcsrc/lib/math.qh +++ b/qcsrc/lib/math.qh @@ -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; }