summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
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.