From e1d8ce31f86e6e5300ca48a9045c3d4b229846c6 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 19 Jan 2009 23:56:01 +0000 Subject: 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 --- crawl-ref/source/effects.cc | 6 ++---- crawl-ref/source/mon-util.cc | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'crawl-ref') 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(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(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(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(looker); + return mons_monster_visible(mon, this); } } -- cgit v1.2.3-54-g00ecf