From fa7df8b0818021b95bf42cb19f86ce294893133a Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Fri, 10 May 2019 06:09:34 +0200 Subject: [PATCH] Core/Spells: fixed a logic error in calculating spell coefficient bonuses that was causing many spells doing less damage than intended --- src/server/game/Entities/Unit/Unit.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c5cec59da4..09d07cb6b9 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6648,8 +6648,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin // Check for table values float coeff = spellProto->Effects[effIndex].BonusMultiplier; - SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); - if (bonus) + if (SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id)) { WeaponAttackType const attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS)); @@ -6672,7 +6671,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin // Default calculation if (DoneAdvertisedBenefit) { - if (!bonus || coeff < 0) + if (coeff < 0) coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack); if (Player* modOwner = GetSpellModOwner())