summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-cast.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r--crawl-ref/source/spl-cast.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 7d8a5784b9..619b67d864 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -670,7 +670,7 @@ bool cast_a_spell(bool check_range)
return (false);
}
- const int minRange = (check_range ? _get_dist_to_nearest_monster() : -1);
+ const int minRange = _get_dist_to_nearest_monster();
int keyin = (check_range ? 0 : '?');
@@ -730,7 +730,7 @@ bool cast_a_spell(bool check_range)
return (false);
}
- if (_spell_no_hostile_in_range(spell, minRange))
+ if (check_range && _spell_no_hostile_in_range(spell, minRange))
{
mpr("There are no visible monsters within range! (Use <w>Z</w> to cast anyway.)");
return (false);