diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-30 14:07:45 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-30 14:07:45 +0000 |
commit | f984dabc74b0a6370e91147b6709b3ca6e591448 (patch) | |
tree | cfdd38d2a66750fc9c1cd5c0942eb1990c81492b /crawl-ref/source/stuff.cc | |
parent | 9f1b85395c59bf30df202366aa077530176196bc (diff) | |
download | crawl-ref-f984dabc74b0a6370e91147b6709b3ca6e591448.tar.gz crawl-ref-f984dabc74b0a6370e91147b6709b3ca6e591448.zip |
Clean up Animate Dead. Also fix messaging.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8853 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stuff.cc')
-rw-r--r-- | crawl-ref/source/stuff.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index ff4f4e64b1..878633e924 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -183,12 +183,13 @@ rectangle_iterator rectangle_iterator::operator++( int dummy ) return (copy); } -radius_iterator::radius_iterator( const coord_def& _center, int _radius, - bool _roguelike_metric, bool _require_los, - bool _exclude_center ) +radius_iterator::radius_iterator(const coord_def& _center, int _radius, + bool _roguelike_metric, bool _require_los, + bool _exclude_center, + const env_show_grid* _losgrid) : center(_center), radius(_radius), roguelike_metric(_roguelike_metric), require_los(_require_los), exclude_center(_exclude_center), - iter_done(false) + losgrid(_losgrid), iter_done(false) { reset(); } @@ -258,8 +259,13 @@ bool radius_iterator::on_valid_square() const return (false); if (!roguelike_metric && (location - center).abs() > radius*radius) return (false); - if (require_los && !see_grid(location)) - return (false); + if (require_los) + { + if (!losgrid && !see_grid(location)) + return (false); + if (losgrid && !see_grid(*losgrid, center, location)) + return (false); + } if (exclude_center && location == center) return (false); |