summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-info.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-07-01 22:26:15 -0400
committerNeil Moore <neil@s-z.org>2014-07-01 22:55:21 -0400
commitffd9f27e324a753ed1090701bdbbf7f0e6d4cd03 (patch)
tree6f21d9998a323ae7f64f8d5743384a872747de89 /crawl-ref/source/mon-info.cc
parent6f411d1547278c84dff7c0003e4ffe350d566e50 (diff)
downloadcrawl-ref-ffd9f27e324a753ed1090701bdbbf7f0e6d4cd03.tar.gz
crawl-ref-ffd9f27e324a753ed1090701bdbbf7f0e6d4cd03.zip
Simplify, optimise, and improve formatting
Diffstat (limited to 'crawl-ref/source/mon-info.cc')
-rw-r--r--crawl-ref/source/mon-info.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/crawl-ref/source/mon-info.cc b/crawl-ref/source/mon-info.cc
index 9f0941fcf5..631ad7629a 100644
--- a/crawl-ref/source/mon-info.cc
+++ b/crawl-ref/source/mon-info.cc
@@ -1815,20 +1815,19 @@ bool monster_info::has_spells() const
const size_t num_books = books.size();
// Random pan lords don't display their spells.
- if (num_books == 0 || books[0] == MST_NO_SPELLS || this->type == MONS_PANDEMONIUM_LORD)
+ if (num_books == 0 || books[0] == MST_NO_SPELLS
+ || type == MONS_PANDEMONIUM_LORD)
+ {
return false;
+ }
// Ghosts have a special book but may not have any spells anyways.
if (books[0] == MST_GHOST)
{
- bool has_spell = false;
for (int i = 0; i < NUM_MONSTER_SPELL_SLOTS; ++i)
- {
if (this->spells[i] != SPELL_NO_SPELL)
- has_spell = true;
- }
- if (!has_spell)
- return false;
+ return true;
+ return false;
}
return true;