summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-19 23:56:01 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-19 23:56:01 +0000
commite1d8ce31f86e6e5300ca48a9045c3d4b229846c6 (patch)
treee6ce71725b3c54a668b7b0ccfeee3b7fd4e5d988 /crawl-ref
parentfad49feb8f562b62d6faf413adc6bdbafa52121c (diff)
downloadcrawl-ref-e1d8ce31f86e6e5300ca48a9045c3d4b229846c6.tar.gz
crawl-ref-e1d8ce31f86e6e5300ca48a9045c3d4b229846c6.zip
Per Haran's suggestion, simplify by using monsters::mindex().
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8606 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/effects.cc6
-rw-r--r--crawl-ref/source/mon-util.cc6
2 files changed, 4 insertions, 8 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 94a6019e5d..6479059e7a 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -342,8 +342,7 @@ void immolation(int pow, int caster, coord_def where, bool known,
else
{
beam.thrower = KILL_MON;
- beam.beam_source =
- monster_index(dynamic_cast<const monsters*>(attacker));
+ beam.beam_source = attacker->mindex();
}
beam.explode();
@@ -391,8 +390,7 @@ void cleansing_flame(int pow, int caster, coord_def where,
else
{
beam.thrower = KILL_MON;
- beam.beam_source =
- monster_index(dynamic_cast<const monsters*>(attacker));
+ beam.beam_source = attacker->mindex();
}
beam.explode();
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index a097aa3ae4..3e03b2cec2 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -5980,10 +5980,7 @@ int monsters::hurt(const actor *agent, int amount, beam_type flavour,
else if (agent->atype() == ACT_PLAYER)
monster_die(this, KILL_YOU, NON_MONSTER);
else
- {
- monster_die(this, KILL_MON,
- monster_index(dynamic_cast<const monsters*>(agent)));
- }
+ monster_die(this, KILL_MON, agent->mindex());
}
return (amount);
@@ -7503,6 +7500,7 @@ bool monsters::visible_to(const actor *looker) const
else
{
const monsters* mon = dynamic_cast<const monsters*>(looker);
+
return mons_monster_visible(mon, this);
}
}