diff options
author | gammafunk <gammafunk@gmail.com> | 2013-06-16 01:56:53 -0500 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2013-10-01 21:27:22 -0400 |
commit | cc16c311df81b95c60ea01a6f81630552e4cc7fc (patch) | |
tree | 96d376b9aa84fa381ed147c81dc7d07a64e55687 /crawl-ref/source/target.cc | |
parent | 7cf365950ecc7ebe657c2a1e493ecbc7f7587cb5 (diff) | |
download | crawl-ref-cc16c311df81b95c60ea01a6f81630552e4cc7fc.tar.gz crawl-ref-cc16c311df81b95c60ea01a6f81630552e4cc7fc.zip |
Fix movement range not being properly checked
Diffstat (limited to 'crawl-ref/source/target.cc')
-rw-r--r-- | crawl-ref/source/target.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crawl-ref/source/target.cc b/crawl-ref/source/target.cc index 0d770d989c..338a132b3d 100644 --- a/crawl-ref/source/target.cc +++ b/crawl-ref/source/target.cc @@ -888,6 +888,7 @@ targetter_jump::targetter_jump(const actor* act, int range) agent = act; origin = act->pos(); range2 = dist_range(range); + landing_range2 = dist_range(range - 1); jump_is_blocked = false; } @@ -945,6 +946,8 @@ bool targetter_jump::valid_landing(coord_def a, bool check_invis) actor *act; ray_def ray; + if ((origin - a).abs() > landing_range2) + return false; if (grd(a) == DNGN_OPEN_SEA || grd(a) == DNGN_LAVA_SEA || !agent->is_habitable(a) || (origin - a).abs() > range2 - 1) { |