diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-17 19:38:25 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-17 19:38:25 +0000 |
commit | 4a2d68e18d05e65c4af2afa7e211146ecb308faa (patch) | |
tree | 1e33e4485efcd14f6b86e3aadf35e2fc9288a094 /crawl-ref/source | |
parent | 0d97be12ecb3a872069127ab959a3c674a010ffb (diff) | |
download | crawl-ref-4a2d68e18d05e65c4af2afa7e211146ecb308faa.tar.gz crawl-ref-4a2d68e18d05e65c4af2afa7e211146ecb308faa.zip |
Fix the aforementioned issue properly. Attacking a god gift in melee
will now result in its staying and attacking you, while the others
disappear, just as with beam/spell attacks.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5109 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/fight.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 9e01ab78f3..63239719cb 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -591,9 +591,6 @@ bool melee_attack::attack() return (true); } - // Allow god to get offended, etc. - attacker->attacking(defender); - // A lot of attack parameters get set in here. 'Ware. to_hit = calc_to_hit(); @@ -605,9 +602,14 @@ bool melee_attack::attack() // Trying to stay general beyond this point is a recipe for insanity. // Maybe when Stone Soup hits 1.0... :-) - return (attacker->atype() == ACT_PLAYER? player_attack() : - defender->atype() == ACT_PLAYER? mons_attack_you() : - mons_attack_mons() ); + bool retval = ((attacker->atype() == ACT_PLAYER) ? player_attack() : + (defender->atype() == ACT_PLAYER) ? mons_attack_you() + : mons_attack_mons()); + + // Allow god to get offended, etc. + attacker->attacking(defender); + + return retval; } static int _modify_blood_amount(const int damage, const int dam_type) |