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:01:52 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-09 11:01:52 -0600
commit901cd59c41d0deb893f203e7411b272350bdb646 (patch)
tree2eed3d4d44319807456d5cddaba1ffc9adffbb97 /crawl-ref/source/mon-util.cc
parent8bb770637637850f522fdeb873e2d0b05eb0be24 (diff)
downloadcrawl-ref-901cd59c41d0deb893f203e7411b272350bdb646.tar.gz
crawl-ref-901cd59c41d0deb893f203e7411b272350bdb646.zip
Simplify check for magic-using monsters.
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index f421cc6b7e..cac9ae6e94 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -2542,15 +2542,9 @@ static bool _ms_ranged_spell(spell_type monspell, bool attack_only = false,
}
}
-bool mons_is_magic_user( const monsters *mon )
+bool mons_is_magic_user(const monsters *mon)
{
- if (mon->is_actual_spellcaster())
- {
- for (int i = 0; i < NUM_MONSTER_SPELL_SLOTS; ++i)
- if (mon->spells[i] != SPELL_NO_SPELL)
- return (true);
- }
- return (false);
+ return (mon->is_actual_spellcaster() && mon->has_spells());
}
// Returns true if the monster has an ability that only needs LOS to