diff options
author | Ovah <dreadkiller@gmx.de> | 2021-10-01 16:38:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-01 16:38:29 +0200 |
commit | e317beb449fb36b9f13c3bda192f86dc72d07581 (patch) | |
tree | c9f35dd272d58aac5a3d0796c1319d86c88fa3ff | |
parent | b1e7f2489c071fefb3cff3bbd295c45c81e7a69c (diff) |
Core/Units: removed an incorrect addition of SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER crit chance benefits (#26873)
This aura, as the name implies, should only affect the spells that it has listed in its class mask. Because the removed code was not doing so, it applied the crit chance on ALL melee and ranged spells. This fixes Stormstrike unintentionally increasing the crit chance for all melee attacks instead of the affected spells only
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e56eeb3a387..e515a048830 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2747,13 +2747,6 @@ float Unit::GetUnitCriticalChanceTaken(Unit const* attacker, WeaponAttackType at else chance += GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE); - chance += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER, [attacker](AuraEffect const* aurEff) -> bool - { - if (aurEff->GetCasterGUID() == attacker->GetGUID()) - return true; - return false; - }); - // reduce crit chance from Rating for players if (attacker->CanApplyResilience()) Unit::ApplyResilience(this, &chance, nullptr, false, (attackType == RANGED_ATTACK ? CR_CRIT_TAKEN_RANGED : CR_CRIT_TAKEN_MELEE)); @@ -7213,8 +7206,7 @@ float Unit::SpellCritChanceTaken(Unit const* caster, SpellInfo const* spellInfo, return 0.f; } - // for this types the bonus was already added in GetUnitCriticalChance, do not add twice - if (caster && spellInfo->DmgClass != SPELL_DAMAGE_CLASS_MELEE && spellInfo->DmgClass != SPELL_DAMAGE_CLASS_RANGED) + if (caster) { crit_chance += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER, [caster, spellInfo](AuraEffect const* aurEff) -> bool { |