summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/mon-util.cc16
-rw-r--r--crawl-ref/source/mon-util.h2
-rw-r--r--crawl-ref/source/monplace.cc2
3 files changed, 13 insertions, 7 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
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index a56be52e68..e4df5ddd19 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -537,8 +537,8 @@ bool mons_is_mimic( int mc );
bool mons_is_statue( int mc );
bool mons_is_demon( int mc );
+bool mons_class_wields_two_weapons(int mc);
bool mons_wields_two_weapons(const monsters *m);
-bool mons_wields_two_weapons(monster_type m);
bool mons_self_destructs(const monsters *m);
bool mons_is_summoned(const monsters *m);
bool mons_is_shapeshifter(const monsters *m);
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index ccbc7c76cd..63b9a6f0be 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -908,7 +908,7 @@ static int _place_monster_aux( const mgen_data &mg,
{
give_item(id, mg.power);
// Give these monsters a second weapon -- bwr
- if (mons_wields_two_weapons(mg.cls))
+ if (mons_class_wields_two_weapons(mg.cls))
give_item(id, mg.power);
unwind_var<int> save_speedinc(menv[id].speed_increment);