From 087352a367f619f093e3fcae757fefadacfb9f12 Mon Sep 17 00:00:00 2001 From: win32 Date: Thu, 17 Dec 2009 13:30:40 +0200 Subject: speed-up code,Thanks QAtson. --HG-- branch : trunk --- src/game/SpellEffects.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 3d6d3ca8671..3f90a52c7df 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2822,12 +2822,14 @@ void Spell::SpellDamageHeal(uint32 /*i*/) { addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); - Unit::AuraEffectList const& Periodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_HEAL); - for (Unit::AuraEffectList::const_iterator i = Periodic.begin(); i != Periodic.end(); ++i) + if (AuraEffect const* aurEff = m_caster->GetAuraEffect(62971, 0)) { - if (m_caster->HasAura(62971)) + Unit::AuraEffectList const& Periodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_HEAL); + for (Unit::AuraEffectList::const_iterator i = Periodic.begin(); i != Periodic.end(); ++i) + { if (m_caster->GetGUID() == (*i)->GetCasterGUID()) - addhealth += addhealth * (*i)->GetParentAura()->GetStackAmount() * 0.06f; + addhealth += addhealth * (*i)->GetParentAura()->GetStackAmount() * aurEff->GetAmount() / 100; + } } } // Riptide - increase healing done by Chain Heal -- cgit v1.2.3