From 6f647bad4a762043ddc6d196680d398c6ce9c4b8 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Sat, 3 Oct 2009 14:31:22 +0200 Subject: Cleanup in melee_attack. potential_damage is only really used in one method, so move it there as a local variable. --- crawl-ref/source/fight.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 605a794723..41df7d43a2 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -346,7 +346,7 @@ melee_attack::melee_attack(actor *attk, actor *defn, defender_starting_attitude(ATT_HOSTILE), unarmed_ok(allow_unarmed), attack_number(which_attack), - to_hit(0), base_damage(0), potential_damage(0), damage_done(0), + to_hit(0), base_damage(0), damage_done(0), special_damage(0), aux_damage(0), stab_attempt(false), stab_bonus(0), weapon(NULL), damage_brand(SPWPN_NORMAL), wpn_skill(SK_UNARMED_COMBAT), hands(HANDS_ONE), hand_half_bonus(false), @@ -838,10 +838,6 @@ bool melee_attack::player_attack() if (cancel_attack) return (false); - potential_damage = - !weapon ? player_calc_base_unarmed_damage() - : player_calc_base_weapon_damage(); - player_apply_attack_delay(); player_stab_check(); @@ -3575,6 +3571,12 @@ bool melee_attack::player_check_monster_died() void melee_attack::player_calc_hit_damage() { + int potential_damage; + + potential_damage = + !weapon ? player_calc_base_unarmed_damage() + : player_calc_base_weapon_damage(); + potential_damage = player_stat_modify_damage(potential_damage); if (water_attack) -- cgit v1.2.3-54-g00ecf