summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapdef.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-05 23:30:01 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-05 23:37:28 -0800
commitd3c2214dea8cb19bcaa4dfe1303f0368e8cdf4aa (patch)
treea12096e5191629b8a6cb335aebdb4652491d6771 /crawl-ref/source/mapdef.cc
parentd6874ba95d47b886b55d0e65310c837206246223 (diff)
downloadcrawl-ref-d3c2214dea8cb19bcaa4dfe1303f0368e8cdf4aa.tar.gz
crawl-ref-d3c2214dea8cb19bcaa4dfe1303f0368e8cdf4aa.zip
Error for non-monster spells in monster specs
Give an error when parsing a monster spec if it lists a spell a monster can't cast, rather than causing an assertion when the monster tries to cast it.
Diffstat (limited to 'crawl-ref/source/mapdef.cc')
-rw-r--r--crawl-ref/source/mapdef.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index a9e0ee0412..402652713e 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -30,6 +30,7 @@
#include "mapmark.h"
#include "maps.h"
#include "misc.h"
+#include "mon-cast.h"
#include "monplace.h"
#include "mon-util.h"
#include "place.h"
@@ -2368,6 +2369,12 @@ void mons_list::parse_mons_spells(mons_spec &spec, const std::string &spells)
spname.c_str(), spells.c_str());
return;
}
+ if (!is_valid_mon_spell(sp))
+ {
+ error = make_stringf("Not a monster spell: '%s'",
+ spname.c_str());
+ return;
+ }
spec.spells[i] = sp;
}
}