diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-07 18:45:09 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-07 18:45:09 +0000 |
commit | 4a27714410c3f8f0f5113421a77e21a43242a0c2 (patch) | |
tree | f309c59a896cac08751a5eec556707cece2d7d17 /crawl-ref | |
parent | b06697749c94d7ef021b6b7224df1a05dde6f7c4 (diff) | |
download | crawl-ref-4a27714410c3f8f0f5113421a77e21a43242a0c2.tar.gz crawl-ref-4a27714410c3f8f0f5113421a77e21a43242a0c2.zip |
Fixed hydra decapitation kills not being correctly credited (Jennifer).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1259 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/externs.h | 6 | ||||
-rw-r--r-- | crawl-ref/source/fight.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index cb4e1f6735..12a6bfb54c 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -144,7 +144,7 @@ public: virtual void attacking(actor *other) = 0; virtual bool can_go_berserk() const = 0; virtual void go_berserk(bool intentional) = 0; - virtual void hurt(actor *attacker, int amount) = 0; + virtual void hurt(const actor *attacker, int amount) = 0; virtual void heal(int amount, bool max_too = false) = 0; virtual void banish(const std::string &who = "") = 0; virtual void blink() = 0; @@ -769,7 +769,7 @@ public: void confuse(int strength); void rot(actor *agent, int rotlevel, int immed_rot); void heal(int amount, bool max_too = false); - void hurt(actor *agent, int amount); + void hurt(const actor *agent, int amount); int holy_aura() const; int warding() const; @@ -1006,7 +1006,7 @@ public: void slow_down(int str); void confuse(int strength); void rot(actor *agent, int rotlevel, int immed_rot); - void hurt(actor *agent, int amount); + void hurt(const actor *agent, int amount); void heal(int amount, bool max_too = false); void blink(); void teleport(bool right_now = false, bool abyss_shift = false); diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 4523166154..3fbc2081d7 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -311,7 +311,7 @@ static bool chop_hydra_head( const actor *attacker, attacker->conj_verb(verb).c_str(), defender->name(DESC_NOCAP_THE).c_str() ); - defender->hit_points = -1; + defender->hurt(attacker, defender->hit_points); } else { diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 420c536589..086a63bd15 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -2808,7 +2808,7 @@ god_type monsters::deity() const return (god); } -void monsters::hurt(actor *agent, int amount) +void monsters::hurt(const actor *agent, int amount) { if (amount <= 0) return; @@ -2820,7 +2820,7 @@ void monsters::hurt(actor *agent, int amount) monster_die(this, KILL_YOU, 0); else monster_die(this, KILL_MON, - monster_index( dynamic_cast<monsters*>(agent) )); + monster_index( dynamic_cast<const monsters*>(agent) )); } } diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index c4b9f89af1..724ccfa21c 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5159,10 +5159,10 @@ void player::teleport(bool now, bool abyss_shift) you_teleport(); } -void player::hurt(actor *agent, int amount) +void player::hurt(const actor *agent, int amount) { if (agent->atype() == ACT_MONSTER) - ouch(amount, monster_index( dynamic_cast<monsters*>(agent) ), + ouch(amount, monster_index( dynamic_cast<const monsters*>(agent) ), KILLED_BY_MONSTER); else { |