Core/Spells: fixed a logic error in calculating spell coefficient bonuses that was causing many spells doing less damage than intended

This commit is contained in:
Ovahlord committed 2019-05-10 06:09:34 +02:00
1 parent 05c6279052
commit fa7df8b081
1 file changed
+2 -3
+2 -3
View File
@@ -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())