summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-10 05:43:17 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-10 05:43:17 +0000
commitd43aba40fe04048d1d032b3b6b105eb45dce4152 (patch)
tree77c2e5bb17ea04da79ce16351e97c5e487aa243a
parent61022d7cf0c3ccf36ffda42664dc17e794a443b9 (diff)
downloadcrawl-ref-d43aba40fe04048d1d032b3b6b105eb45dce4152.tar.gz
crawl-ref-d43aba40fe04048d1d032b3b6b105eb45dce4152.zip
If mons_spells() is given an unknown monster spell then assert with the name of
the spell and the name of the casting monster, rather than just "Unknown spell". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8374 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/mstuff2.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index a86f519f64..d42c4c19cf 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -1612,7 +1612,7 @@ bolt mons_spells( monsters *mons, spell_type spell_cast, int power )
const int drac_type = (mons_genus(mons->type) == MONS_DRACONIAN)
? draco_subspecies(mons) : mons->type;
- int real_spell = spell_cast;
+ spell_type real_spell = spell_cast;
if (spell_cast == SPELL_DRACONIAN_BREATH)
{
@@ -1943,6 +1943,7 @@ bolt mons_spells( monsters *mons, spell_type spell_cast, int power )
break;
case SPELL_BLINK:
+ case SPELL_CONTROLLED_BLINK:
beam.is_beam = false;
break;
@@ -2222,7 +2223,15 @@ bolt mons_spells( monsters *mons, spell_type spell_cast, int power )
break;
default:
- DEBUGSTR("Unknown spell");
+ if (!is_valid_spell(real_spell))
+ DEBUGSTR("Invalid spell #%d cast by %s", (int) real_spell,
+ mons->name(DESC_PLAIN, true).c_str());
+
+ DEBUGSTR("Unknown monster spell '%s' cast by %s",
+ spell_title(real_spell),
+ mons->name(DESC_PLAIN, true).c_str());
+
+ return (beam);
}
if (spell_cast == SPELL_DRACONIAN_BREATH)