From e317beb449fb36b9f13c3bda192f86dc72d07581 Mon Sep 17 00:00:00 2001 From: Ovah Date: Fri, 1 Oct 2021 16:38:29 +0200 Subject: 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 --- src/server/game/Entities/Unit/Unit.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src') 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 { -- cgit v1.2.3