diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/spl-util.cc | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 60b6e7ef46..364feab6f5 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -1932,7 +1932,7 @@ bool ms_direct_nasty(spell_type monspell) // the player is not in sight. bool ms_useful_fleeing_out_of_sight( const monsters *mon, spell_type monspell ) { - if (ms_waste_of_time( mon, monspell )) + if (monspell == SPELL_NO_SPELL || ms_waste_of_time( mon, monspell )) return (false); switch (monspell) @@ -2150,6 +2150,10 @@ bool ms_waste_of_time( const monsters *mon, spell_type monspell ) break; + case SPELL_NO_SPELL: + ret = true; + break; + default: break; } diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index 2aec6deff0..38c783d9e1 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -44,7 +44,6 @@ #include <conio.h> #endif - static struct spell_desc spelldata[] = { #include "spl-data.h" }; @@ -298,8 +297,7 @@ int count_bits(unsigned int bits) const char *spell_title(spell_type spell) { - const spell_desc *spd = seekspell(spell); - return (spd? spd->title : NULL); + return (seekspell(spell)->title); } @@ -881,7 +879,8 @@ int spell_type2skill(unsigned int spelltype) static spell_desc *seekspell(spell_type spell) { const int index = spell_list[spell]; - return (index != -1? &spelldata[index] : NULL); + ASSERT(index != -1); + return (&spelldata[index]); } static bool cloud_helper(int (*func)(int, int, int, int, cloud_type, |