summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ray.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/ray.cc')
-rw-r--r--crawl-ref/source/ray.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/crawl-ref/source/ray.cc b/crawl-ref/source/ray.cc
index 69d43f5da8..6418386a61 100644
--- a/crawl-ref/source/ray.cc
+++ b/crawl-ref/source/ray.cc
@@ -84,13 +84,18 @@ static bool in_non_diamond_int(const geom::vector &v)
return (!in_diamond(v) && !on_line(v));
}
+static coord_def round_vec(const geom::vector &v)
+{
+ int x = ifloor(v.x);
+ int y = ifloor(v.y);
+ return (coord_def(x, y));
+}
+
coord_def ray_def::pos() const
{
// XXX: pretty arbitrary if we're just on a corner.
- int x = ifloor(r.start.x);
- int y = ifloor(r.start.y);
- return (coord_def(x, y));
+ return (round_vec(r.start));
}
static bool _advance_from_non_diamond(geom::ray *r)