summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/geom2d.cc
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/geom2d.cc
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/geom2d.cc')
-rw-r--r--crawl-ref/source/geom2d.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/geom2d.cc b/crawl-ref/source/geom2d.cc
index 74a79342c5..a12e9d90a6 100644
--- a/crawl-ref/source/geom2d.cc
+++ b/crawl-ref/source/geom2d.cc
@@ -13,7 +13,7 @@ namespace geom
static bool double_is_zero(double d)
{
- return abs(d) < 0.0000001;
+ return abs(d) < 0.00005;
}
// Is v parallel to the kernel of f?