summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-cast.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-05-04 19:20:28 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-05-04 19:20:28 +0000
commitc68ef2df6780db4bd3b16a50de06f7f528a31336 (patch)
tree1afdaad186f5db466de1c7555e8e2b301883e280 /crawl-ref/source/spl-cast.cc
parent6945b9d587b894371ba4d6d99f9ee1b8ee3beb86 (diff)
downloadcrawl-ref-c68ef2df6780db4bd3b16a50de06f7f528a31336.tar.gz
crawl-ref-c68ef2df6780db4bd3b16a50de06f7f528a31336.zip
* Some more tweaks to the spellcasting interface.
* Colour items out of range darkgrey, like we do for floor/monsters. * Fix berserk monsters choosing one of the nearest monsters randomly. (Seriously, I must have been half asleep when I wrote that.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9733 c06c8d41-db1a-0410-9941-cceddc491573
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);