summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/mon-util.cc11
-rw-r--r--crawl-ref/source/mon-util.h5
-rw-r--r--crawl-ref/source/monplace.cc6
3 files changed, 14 insertions, 8 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 807b37b010..312e5ae795 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1351,7 +1351,7 @@ int mons_difficulty(int mtype)
+ me->hpdice[3]);
}
-int exper_value( const struct monsters *monster )
+int exper_value(const monsters *monster)
{
long x_val = 0;
@@ -1361,7 +1361,7 @@ int exper_value( const struct monsters *monster )
const int maxhp = monster->max_hit_points;
// These are some values we care about.
- const int speed = mons_speed(mclass);
+ const int speed = mons_speed(monster);
const int modifier = _mons_exp_mod(mclass);
const int item_usage = mons_itemuse(monster);
@@ -2011,12 +2011,17 @@ static int _mons_exp_mod(int mc)
return (smc->exp_mod);
}
-int mons_speed(int mc)
+int mons_class_speed(int mc)
{
ASSERT(smc);
return (smc->speed);
}
+int mons_speed(const monsters *mon)
+{
+ return (mons_class_speed(mon->type));
+}
+
mon_intel_type mons_class_intel(int mc)
{
ASSERT(smc);
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index 2232cf4b55..7e9b8bb3b1 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -483,7 +483,7 @@ bool mons_is_unique(int mclass);
* *********************************************************************** */
// int exper_value(int mclass, int mHD, int maxhp);
int mons_difficulty(int mtype);
-int exper_value( const monsters *monster );
+int exper_value(const monsters *monster);
// last updated 12may2000 {dlb}
@@ -591,7 +591,8 @@ int mons_weight(int mclass);
/* ***********************************************************************
* called from: monplace mon-util
* *********************************************************************** */
-int mons_speed(int mclass);
+int mons_class_speed(int mc);
+int mons_speed(const monsters *mon);
// last updated 12may2000 {dlb}
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 00bd5c8613..4b272beff3 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -619,9 +619,9 @@ int place_monster(mgen_data mg, bool force_pos)
if (mg.proximity == PROX_NEAR_STAIRS)
{
// For some cases disallow monsters on stairs.
- if (mons_class_is_stationary( mg.cls )
+ if (mons_class_is_stationary(mg.cls)
|| (pval == 2 // Stairs occupied by player.
- && (mons_speed(mg.cls) == 0 || grd(mg.pos) == DNGN_LAVA
+ && (mons_class_speed(mg.cls) == 0 || grd(mg.pos) == DNGN_LAVA
|| grd(mg.pos) == DNGN_DEEP_WATER)))
{
mg.proximity = PROX_AWAY_FROM_PLAYER;
@@ -688,7 +688,7 @@ int place_monster(mgen_data mg, bool force_pos)
if (pval == 2) // player on stairs
{
// 0 speed monsters can't shove player out of their way.
- if (mons_speed(mg.cls) == 0)
+ if (mons_class_speed(mg.cls) == 0)
{
proxOK = false;
break;