summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-09 11:12:43 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-09 11:12:43 -0600
commit9e4097d1feda1a12a41ba8e1c05b693bd3729abe (patch)
tree5d54be8e06a17997027e8889e810549c587cd17d /crawl-ref/source/mon-util.cc
parent4789c1cf285f0de96470329db39f761280747d1d (diff)
downloadcrawl-ref-9e4097d1feda1a12a41ba8e1c05b693bd3729abe.tar.gz
crawl-ref-9e4097d1feda1a12a41ba8e1c05b693bd3729abe.zip
And add sanity check.
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 6980a3f345..458d2005b3 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1556,11 +1556,12 @@ void define_monster(monsters &mons)
if (m->sec == MST_NO_SPELLS && mons_class_flag(mons.type, M_SPELLCASTER))
{
mon_spellbook_type book[6];
- _get_spellbook_list(book, mons.type);
-
- do
- spells = book[random2(6)];
- while (spells == MST_NO_SPELLS);
+ if (_get_spellbook_list(book, mons.type))
+ {
+ do
+ spells = book[random2(6)];
+ while (spells == MST_NO_SPELLS);
+ }
}
// Some calculations.