aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-03-01 23:18:49 -0300
committerShauren <shauren.trinity@gmail.com>2021-08-18 22:59:50 +0200
commitb0a05812d23aa1ebe69045243233a5eaba064f11 (patch)
tree73a2361f6c2f231da71086661140104edbf8f8dc /src
parent6c642f33b58ce81eb5b1345a7f0eb89de6040251 (diff)
Core/Auras: fixed SPELL_AURA_MOD_HIT_CHANCE honoring stack rules in all cases
Updates #21367 (cherry picked from commit 23808fe349e78118461c08ebe78c8892391be236)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp8
1 files changed, 5 insertions, 3 deletions
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;
}
}