summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-02 18:49:18 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-02 18:49:18 +0000
commit3ef70e6dea67553bc7f0748e57434b8fa8dc82cf (patch)
treecb1012bc18bf933615b2433dd85dfcb24c3ba668
parent02f124467ef2c4f86de56628fa0ce76f77bc126c (diff)
downloadcrawl-ref-3ef70e6dea67553bc7f0748e57434b8fa8dc82cf.tar.gz
crawl-ref-3ef70e6dea67553bc7f0748e57434b8fa8dc82cf.zip
Use monsters::mindex() in a few more places.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9314 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/beam.cc2
-rw-r--r--crawl-ref/source/decks.cc5
-rw-r--r--crawl-ref/source/player.cc4
-rw-r--r--crawl-ref/source/spl-mis.cc2
4 files changed, 5 insertions, 8 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 999d0b58b3..09fb4c65c1 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -2652,7 +2652,7 @@ void fire_tracer(const monsters *monster, bolt &pbolt, bool explode_only)
// Don't fiddle with any input parameters other than tracer stuff!
pbolt.is_tracer = true;
pbolt.source = monster->pos();
- pbolt.beam_source = monster_index(monster);
+ pbolt.beam_source = monster->mindex();
pbolt.can_see_invis = mons_see_invis(monster);
pbolt.smart_monster = (mons_intel(monster) >= I_NORMAL);
pbolt.attitude = mons_attitude(monster);
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index f3a1e29f0c..bf4da0ac89 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -1375,9 +1375,7 @@ static void _swap_monster_card(int power, deck_rarity_type rarity)
// Don't choose yourself unless there are no monsters nearby.
monsters *mon_to_swap = choose_random_nearby_monster(0);
if (!mon_to_swap)
- {
mpr("You spin around.");
- }
else
{
monsters& mon(*mon_to_swap);
@@ -1401,8 +1399,7 @@ static void _swap_monster_card(int power, deck_rarity_type rarity)
mon.moveto(you.pos());
// Plunk it down.
- mgrd(mon.pos()) = monster_index(mon_to_swap);
-
+ mgrd(mon.pos()) = mon_to_swap->mindex();
if (you_caught)
{
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 436039914d..c8af10a78b 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2636,7 +2636,7 @@ bool player_mesmerised_by(const monsters *mon)
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "mesmerised_by.size: %d, DUR_MESMERISED: %d, "
"current mon: %d", you.mesmerised_by.size(),
- you.duration[DUR_MESMERISED], monster_index(mon));
+ you.duration[DUR_MESMERISED], mon->mindex());
#endif
if (you.mesmerised_by.empty()) // shouldn't happen
@@ -6919,7 +6919,7 @@ int player::hurt(const actor *agent, int amount, beam_type flavour,
const monsters *mon = dynamic_cast<const monsters*>(agent);
if (agent->atype() == ACT_MONSTER)
{
- ouch(amount, monster_index(mon),
+ ouch(amount, mon->mindex(),
KILLED_BY_MONSTER, "", player_monster_visible(mon));
}
else
diff --git a/crawl-ref/source/spl-mis.cc b/crawl-ref/source/spl-mis.cc
index 76d2dd8850..63d467ee87 100644
--- a/crawl-ref/source/spl-mis.cc
+++ b/crawl-ref/source/spl-mis.cc
@@ -705,7 +705,7 @@ bool MiscastEffect::_create_monster(monster_type what, int abj_deg,
}
if (alert)
- data.foe = monster_index(mon_target);
+ data.foe = mon_target->mindex();
// No permanent allies from miscasts.
if (data.behaviour == BEH_FRIENDLY && abj_deg == 0)