From c68ef2df6780db4bd3b16a50de06f7f528a31336 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 4 May 2009 19:20:28 +0000 Subject: * 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 --- crawl-ref/source/spl-cast.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/spl-cast.cc') 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 Z to cast anyway.)"); return (false); -- cgit v1.2.3-54-g00ecf