diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-15 15:06:01 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-15 15:06:01 +0200 |
commit | 39eb1bb024270d8eca413c929eb9508a382fb113 (patch) | |
tree | d075ac85394845a91b00a122aa31804a18ee16e8 /crawl-ref/source/los.cc | |
parent | 0291d82e0012527af5c70c5c4b77ed73d211fe5a (diff) | |
download | crawl-ref-39eb1bb024270d8eca413c929eb9508a382fb113.tar.gz crawl-ref-39eb1bb024270d8eca413c929eb9508a382fb113.zip |
More sanity checks in find_ray.
Diffstat (limited to 'crawl-ref/source/los.cc')
-rw-r--r-- | crawl-ref/source/los.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc index 7dac2fee74..4fa567d091 100644 --- a/crawl-ref/source/los.cc +++ b/crawl-ref/source/los.cc @@ -563,6 +563,8 @@ bool _find_ray_se(const coord_def& target, ray_def& ray, bool ignore_solid, trans t) { ASSERT(target.x >= 0 && target.y >= 0 && !target.origin()); + if (target.abs() > LOS_RADIUS2) + return false; bool found = false; int imbalance = INFINITE_DISTANCE; @@ -658,7 +660,7 @@ bool find_ray(const coord_def& source, const coord_def& target, ray_def& ray, int cycle_dir, bool find_best, bool ignore_solid) { - if (target == source) + if (target == source || !map_bounds(source) || !map_bounds(target)) return false; const int signx = ((target.x - source.x >= 0) ? 1 : -1); |