diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-13 12:38:31 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-13 12:38:31 +0000 |
commit | d436eeaf8f01d5e9b0476254171b6a0bcc2c403d (patch) | |
tree | 6aaf27955df1ada2cd90d4159c98afa1c9b48354 /crawl-ref/source/misc.cc | |
parent | a09546a8bd90676ada9dbf82788321a709e6a6b0 (diff) | |
download | crawl-ref-d436eeaf8f01d5e9b0476254171b6a0bcc2c403d.tar.gz crawl-ref-d436eeaf8f01d5e9b0476254171b6a0bcc2c403d.zip |
is_orckind() and is_dragonkind() no longer duplicate their arguments.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8443 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index dd5765ecf3..65ad96c77b 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -3154,22 +3154,25 @@ bool stop_attack_prompt(const monsters *mon, bool beam_attack, return (retval); } -bool is_orckind(const actor *act, const monsters *mon) +bool is_orckind(const actor *act) { if (mons_genus(act->mons_species()) == MONS_ORC) return (true); - if (act->atype() == ACT_MONSTER - && mons_is_zombified(mon) - && mons_genus(mon->base_monster) == MONS_ORC) + if (act->atype() == ACT_MONSTER) { - return (true); + const monsters* mon = dynamic_cast<const monsters*>(act); + if (mons_is_zombified(mon) + && mons_genus(mon->base_monster) == MONS_ORC) + { + return (true); + } } return (false); } -bool is_dragonkind(const actor *act, const monsters *mon) +bool is_dragonkind(const actor *act) { if (mons_genus(act->mons_species()) == MONS_DRAGON || mons_genus(act->mons_species()) == MONS_DRACONIAN) @@ -3183,6 +3186,7 @@ bool is_dragonkind(const actor *act, const monsters *mon) || you.attribute[ATTR_TRANSFORMATION] == TRAN_SERPENT_OF_HELL); } // else the actor is a monster + const monsters* mon = dynamic_cast<const monsters*>(act); if (mon->type == MONS_SERPENT_OF_HELL) return (true); |