summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/los.h
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-06-15 01:45:05 -0400
committerNeil Moore <neil@s-z.org>2014-06-15 01:50:59 -0400
commitdf1f371a6ddd6e0c5a26a34d431ba7161af991a0 (patch)
tree6911becc16ee172864f96ebac5735b2a1c854075 /crawl-ref/source/los.h
parent546f9a454f9155ca3d1ecff5c11fc6d7b27c91fc (diff)
downloadcrawl-ref-df1f371a6ddd6e0c5a26a34d431ba7161af991a0.tar.gz
crawl-ref-df1f371a6ddd6e0c5a26a34d431ba7161af991a0.zip
Round more vigorously in ray code.
Aiming cloud cone from (40,41) or (66,23) would crash because of rounding errors. See for example: http://dobrazupa.org/morgue/Rikonman/crash-Rikonman-20140425-000700.txt Now consider numbers as large as 5e-5 to be zero, rather than requiring 1e-7 (for geom2d code) or 1e-5 (ray_def code). This means rays will be snapped to the diamond grid more frequently, helping to avoid inconsistencies among different ways of deciding what part of the cell a ray falls on. Someone with numerical analysis experience should really look at this code.
Diffstat (limited to 'crawl-ref/source/los.h')
-rw-r--r--crawl-ref/source/los.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/los.h b/crawl-ref/source/los.h
index b68b83d990..dc2e9cdbd8 100644
--- a/crawl-ref/source/los.h
+++ b/crawl-ref/source/los.h
@@ -12,7 +12,7 @@
class circle_def;
struct ray_def;
-#define EPSILON_VALUE 0.00001
+#define EPSILON_VALUE 0.00005
bool double_is_zero(const double x);