Skip to content

Commit

Permalink
Unit/CalcAbsorbResist: Sanctified Wrath should pierce absorb effects
Browse files Browse the repository at this point in the history
by P-Kito; retrieved from #15027

The paladin talent Sanctified Wrath should pierce absorb effects.

(cherry picked from commit b8762d8)
  • Loading branch information
P-Kito authored and Shauren committed Apr 2, 2016
1 parent 50ad1cc commit cd435b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/server/game/Entities/Unit/Unit.cpp
Expand Up @@ -1639,6 +1639,9 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe

RoundToInterval(auraAbsorbMod, 0.0f, 100.0f);

uint32 absorbIgnoringDamage = CalculatePct(dmgInfo.GetDamage(), auraAbsorbMod);
dmgInfo.ModifyDamage(-absorbIgnoringDamage);

// We're going to call functions which can modify content of the list during iteration over it's elements
// Let's copy the list so we can prevent iterator invalidation
AuraEffectList vSchoolAbsorbCopy(victim->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB));
Expand Down Expand Up @@ -1671,9 +1674,6 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
if (defaultPrevented)
continue;

// Apply absorb mod auras
AddPct(currentAbsorb, -auraAbsorbMod);

// absorb must be smaller than the damage itself
currentAbsorb = RoundToInterval(currentAbsorb, 0, int32(dmgInfo.GetDamage()));

Expand Down Expand Up @@ -1722,8 +1722,6 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
if (defaultPrevented)
continue;

AddPct(currentAbsorb, -auraAbsorbMod);

// absorb must be smaller than the damage itself
currentAbsorb = RoundToInterval(currentAbsorb, 0, int32(dmgInfo.GetDamage()));

Expand Down Expand Up @@ -1752,6 +1750,8 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
}
}

dmgInfo.ModifyDamage(absorbIgnoringDamage);

// split damage auras - only when not damaging self
if (victim != this)
{
Expand Down

0 comments on commit cd435b1

Please sign in to comment.