summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-16 22:34:03 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-16 22:34:03 +0000
commit9f612e8e98d87fa9a3dc73907802b0782a9901ff (patch)
treedf73e524382a9653f5adcc88b35c42a4ce6d4e2c /crawl-ref/source/mon-util.cc
parentfcd2f73d85997682a9c89c897348ae8e32432589 (diff)
downloadcrawl-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.cc16
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