diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-01 13:13:31 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-01 13:13:31 +0000 |
commit | 2dc2beee3b4479c6061787881d22341cbb21a33d (patch) | |
tree | e1b034e32ad986662273d5dfd4ae8519287666e2 /crawl-ref/source/spl-util.cc | |
parent | 277c955d26422708f591a0d849eb4eae1d2ab146 (diff) | |
download | crawl-ref-2dc2beee3b4479c6061787881d22341cbb21a33d.tar.gz crawl-ref-2dc2beee3b4479c6061787881d22341cbb21a33d.zip |
Filter out SPELL_NO_SPELL from fleeing monster decisions (redundant in trunk, but the checks do no harm). seekspell now asserts when it's asked for a bad spell.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4015 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-util.cc')
-rw-r--r-- | crawl-ref/source/spl-util.cc | 7 |
1 files changed, 3 insertions, 4 deletions
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, |