summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc14
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)