From baf6623be0bcc317fa80db93be0943d2bf44573b Mon Sep 17 00:00:00 2001 From: GuybrushGit Date: Wed, 29 Nov 2017 02:50:42 +0000 Subject: [PATCH] Fix to weapon secondary damage (#579) --- src/game/Spells/SpellEffects.cpp | 8 +++++++- src/game/StatSystem.cpp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index 7bd8cb19f..c2e12a4a8 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -4111,7 +4111,13 @@ void Spell::EffectWeaponDmg(SpellEffectIndex eff_idx) } // + weapon damage with applied weapon% dmg to base weapon damage in call - bonus += int32(m_caster->CalculateDamage(m_attackType, normalized) * weaponDamagePercentMod); + for (uint8 i = 0; i < m_caster->GetWeaponDamageCount(m_attackType); i++) + { + if (unitTarget->IsImmuneToDamage(GetSchoolMask(m_caster->GetWeaponDamageSchool(m_attackType, i)))) + continue; + + bonus += int32(m_caster->CalculateDamage(m_attackType, normalized, i) * weaponDamagePercentMod); + } // Seal of Command if (m_spellInfo->School == SPELL_SCHOOL_HOLY) diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 344b19d4e..322d7cff2 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -421,7 +421,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, fl weapon_mindamage = BASE_MINDAMAGE; weapon_maxdamage = BASE_MAXDAMAGE; } - else if (attType == RANGED_ATTACK) // add ammo DPS to ranged damage + else if (attType == RANGED_ATTACK && index == 0) // add ammo DPS to ranged damage { weapon_mindamage += GetAmmoDPS() * att_speed; weapon_maxdamage += GetAmmoDPS() * att_speed;