diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-13 19:15:25 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-13 19:16:08 +0200 |
commit | 71d9e45b127b002654c77e677929401b9274ca43 (patch) | |
tree | ed4cd35f7412360d7b1ce36dc8a8f42e2d39a2d6 /crawl-ref/source/los.cc | |
parent | 2eaca2a4e591b1a7cc7a960030e86036ec1f437e (diff) | |
download | crawl-ref-71d9e45b127b002654c77e677929401b9274ca43.tar.gz crawl-ref-71d9e45b127b002654c77e677929401b9274ca43.zip |
Fix bug in find_ray that made 'f' targetting pass through walls.
Diffstat (limited to 'crawl-ref/source/los.cc')
-rw-r--r-- | crawl-ref/source/los.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc index 849cee39e2..a608ae03c0 100644 --- a/crawl-ref/source/los.cc +++ b/crawl-ref/source/los.cc @@ -576,7 +576,6 @@ bool find_ray(const coord_def& source, const coord_def& target, const int absy = signy * (targety - sourcey); const coord_def abs = coord_def(absx, absy); - int cur_offset = 0; int shortest = INFINITE_DISTANCE; int imbalance = INFINITE_DISTANCE; const double want_slope = _calc_slope(absx, absy); @@ -605,8 +604,8 @@ bool find_ray(const coord_def& source, const coord_def& target, int real_length = 0; for (inray = 0; inray <= cellray; ++inray) { - const int xi = signx * ray_coords[inray + cur_offset].x; - const int yi = signy * ray_coords[inray + cur_offset].y; + const int xi = signx * ray_coords[inray + fullrays[fray].start].x; + const int yi = signy * ray_coords[inray + fullrays[fray].start].y; if (inray < cellray && !ignore_solid && grid_is_solid(grd[sourcex + xi][sourcey + yi])) { |