diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-16 22:34:03 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-16 22:34:03 +0000 |
commit | 9f612e8e98d87fa9a3dc73907802b0782a9901ff (patch) | |
tree | df73e524382a9653f5adcc88b35c42a4ce6d4e2c /crawl-ref/source/mon-util.cc | |
parent | fcd2f73d85997682a9c89c897348ae8e32432589 (diff) | |
download | crawl-ref-9f612e8e98d87fa9a3dc73907802b0782a9901ff.tar.gz crawl-ref-9f612e8e98d87fa9a3dc73907802b0782a9901ff.zip |
Properly handle zombified dual-wielding monsters.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7264 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 96ec1a46a9..46e1afc06b 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -1455,6 +1455,7 @@ bool mons_amphibious(const monsters *mon) { const int montype = mons_is_zombified(mon) ? mons_zombie_base(mon) : mon->type; + return (mons_class_amphibious(montype)); } @@ -1467,6 +1468,7 @@ bool mons_wall_shielded(const monsters *mon) { const int montype = mons_is_zombified(mon) ? mons_zombie_base(mon) : mon->type; + return (mons_class_wall_shielded(montype)); } @@ -2280,14 +2282,17 @@ bool mons_atts_aligned(mon_attitude_type fr1, mon_attitude_type fr2) return (fr1 == fr2); } -bool mons_wields_two_weapons(monster_type m) +bool mons_class_wields_two_weapons(int mc) { - return mons_class_flag(m, M_TWOWEAPON); + return (mons_class_flag(mc, M_TWOWEAPON)); } -bool mons_wields_two_weapons(const monsters *m) +bool mons_wields_two_weapons(const monsters *mon) { - return (mons_wields_two_weapons(static_cast<monster_type>(m->type))); + const int montype = mons_is_zombified(mon) ? mons_zombie_base(mon) + : mon->type; + + return (mons_class_wields_two_weapons(montype)); } bool mons_eats_corpses(const monsters *m) @@ -3265,7 +3270,8 @@ bool mons_can_pass(const monsters *mon, dungeon_feature_type grid) { const int montype = mons_is_zombified(mon) ? mons_zombie_base(mon) : mon->type; - return mons_class_can_pass(montype, grid); + + return (mons_class_can_pass(montype, grid)); } bool monsters::can_pass_through_feat(dungeon_feature_type grid) const |