Skip to content

Commit

Permalink
Don't double all player melee damage (Revert e0bdd66)
Browse files Browse the repository at this point in the history
This commit tried to fix a rare crash, but obviously this bug is worse.

(cherry picked from commit c3c9679)
  • Loading branch information
SeveMonahan authored and elliptic committed Mar 22, 2015
1 parent 811c1d7 commit 484a79e
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions crawl-ref/source/melee_attack.cc
Expand Up @@ -412,20 +412,24 @@ bool melee_attack::handle_phase_hit()
}
}

damage_done = 0;
// Slimify does no damage and serves as an on-hit effect, handle it
if (attacker->is_player() && you.duration[DUR_SLIMIFY]
&& mon_can_be_slimified(defender->as_monster())
&& !cleaving)
{
// Bail out after sliming so we don't get aux unarmed and
// attack a fellow slime.
damage_done = 0;
slimify_monster(defender->as_monster());
you.duration[DUR_SLIMIFY] = 0;

return false;
}

// This does more than just calculate the damage, it also sets up
// messages, etc.
damage_done = calc_damage();

if (attacker->is_player() && you.duration[DUR_INFUSION])
{
if (enough_mp(1, true, false))
Expand All @@ -439,18 +443,12 @@ bool melee_attack::handle_phase_hit()

if (hurt > 0)
{
damage_done = hurt;
damage_done += hurt;
dec_mp(1);
}
}
}

// This does more than just calculate the damage, it also sets up
// messages, etc. It also wakes nearby creatures on a failed stab,
// meaning it could have made the attacked creature vanish. That
// will be checked early in player_monattack_hit_effects
damage_done += calc_damage();

bool stop_hit = false;
// Check if some hit-effect killed the monster.
if (attacker->is_player())
Expand Down Expand Up @@ -1882,12 +1880,6 @@ bool melee_attack::player_monattk_hit_effects()
{
player_weapon_upsets_god();

// Don't even check vampire bloodletting if the monster has already
// been reset (for example, a spectral weapon who noticed in
// player_stab_check that it shouldn't exist anymore).
if (defender->type == MONS_NO_MONSTER)
return false;

// Thirsty vampires will try to use a stabbing situation to draw blood.
if (you.species == SP_VAMPIRE && you.hunger_state < HS_SATIATED
&& damage_done > 0 && stab_attempt && stab_bonus > 0
Expand Down

0 comments on commit 484a79e

Please sign in to comment.