summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-03 14:31:22 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-06 17:32:06 +0200
commit6f647bad4a762043ddc6d196680d398c6ce9c4b8 (patch)
treebfa4faf1d26ce5749a88e5d2b9ed50fcfc96529b /crawl-ref/source/fight.cc
parentf460cbf1c8a27df7d9037304830d4a41b84a1e9e (diff)
downloadcrawl-ref-6f647bad4a762043ddc6d196680d398c6ce9c4b8.tar.gz
crawl-ref-6f647bad4a762043ddc6d196680d398c6ce9c4b8.zip
Cleanup in melee_attack.
potential_damage is only really used in one method, so move it there as a local variable.
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc12
1 files changed, 7 insertions, 5 deletions
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)