From b0a05812d23aa1ebe69045243233a5eaba064f11 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 1 Mar 2018 23:18:49 -0300 Subject: Core/Auras: fixed SPELL_AURA_MOD_HIT_CHANCE honoring stack rules in all cases Updates #21367 (cherry picked from commit 23808fe349e78118461c08ebe78c8892391be236) --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index eccc74b44f1..abc447b79b9 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3950,13 +3950,14 @@ void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, u target->UpdateAllWeaponDependentCritAuras(); } -void AuraEffect::HandleModHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const +void AuraEffect::HandleModHitChance(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const { if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) return; Unit* target = aurApp->GetTarget(); + // handle stack rules if (target->GetTypeId() == TYPEID_PLAYER) { target->ToPlayer()->UpdateMeleeHitChances(); @@ -3964,8 +3965,9 @@ void AuraEffect::HandleModHitChance(AuraApplication const* aurApp, uint8 mode, b } else { - target->m_modMeleeHitChance += (apply) ? GetAmount() : (-GetAmount()); - target->m_modRangedHitChance += (apply) ? GetAmount() : (-GetAmount()); + float value = target->GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE); + target->m_modMeleeHitChance = value; + target->m_modRangedHitChance = value; } } -- cgit v1.2.3