diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-09 11:01:52 -0600 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-09 11:01:52 -0600 |
commit | 901cd59c41d0deb893f203e7411b272350bdb646 (patch) | |
tree | 2eed3d4d44319807456d5cddaba1ffc9adffbb97 /crawl-ref/source/mon-util.cc | |
parent | 8bb770637637850f522fdeb873e2d0b05eb0be24 (diff) | |
download | crawl-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.cc | 10 |
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 |