summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/spl-util.cc')
-rw-r--r--crawl-ref/source/spl-util.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index e250f55931..e7a5503e0e 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -990,6 +990,10 @@ int spell_range(spell_type spell, int pow, bool real_cast, bool player_spell)
int maxrange = _seekspell(spell)->max_range;
ASSERT(maxrange >= minrange);
+ // spells with no range have maxrange == minrange == -1
+ if (maxrange < 0)
+ return maxrange;
+
// Sandblast is a special case.
if (spell == SPELL_SANDBLAST && wielding_rocks())
{