From 4a2d68e18d05e65c4af2afa7e211146ecb308faa Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 17 May 2008 19:38:25 +0000 Subject: 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 --- crawl-ref/source/fight.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/fight.cc') 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) -- cgit v1.2.3-54-g00ecf