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/mon-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/mon-util.cc')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 6 |
1 files changed, 5 insertions, 1 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; } |