diff options
-rw-r--r-- | crawl-ref/source/beam.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/ray.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/ray.h | 5 |
3 files changed, 9 insertions, 3 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 3fa146fb4b..d8ab5d18c8 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1634,7 +1634,10 @@ void bolt::bounce() while (feat_is_solid(grd(ray.pos()))); bounce_pos = ray.pos(); - ray.advance_and_bounce(); + reflect_grid rg; + for (adjacent_iterator ai(ray.pos()); ai; ++ai) + rg(*ai) = feat_is_solid(grd(ray.pos())); + ray.bounce(rg); range_used += 2; } while (range_used < range && feat_is_solid(grd(ray.pos()))); diff --git a/crawl-ref/source/ray.cc b/crawl-ref/source/ray.cc index 74d402c7ce..dff1d3e82a 100644 --- a/crawl-ref/source/ray.cc +++ b/crawl-ref/source/ray.cc @@ -66,7 +66,7 @@ bool ray_def::advance() } } -void ray_def::advance_and_bounce() +void ray_def::bounce(const reflect_grid &rg) { // XXX r.dir = -r.dir; diff --git a/crawl-ref/source/ray.h b/crawl-ref/source/ray.h index 671ca0fa8a..cc7688571d 100644 --- a/crawl-ref/source/ray.h +++ b/crawl-ref/source/ray.h @@ -6,8 +6,11 @@ #ifndef RAY_H #define RAY_H +#include "fixary.h" #include "geom2d.h" +typedef FixedArray<bool,3,3> reflect_grid; + struct ray_def { geom::ray r; @@ -20,7 +23,7 @@ struct ray_def coord_def pos() const; bool advance(); - void advance_and_bounce(); + void bounce(const reflect_grid &rg); void regress(); }; |