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;
}