diff options
author | QAston <none@none> | 2009-06-06 13:45:17 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-06-06 13:45:17 +0200 |
commit | aa468c964a55f592b2b78c1ceb11e633cc49f10a (patch) | |
tree | cb5ff4f9ca824a12d77084eb4a85b7fdce00331c | |
parent | e6941a4f412a442ca97ef1b454837f74077e5f6c (diff) |
*Fix dash bonus not working in some cases.
--HG--
branch : trunk
-rw-r--r-- | src/game/SpellAuras.cpp | 16 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 3 | ||||
-rw-r--r-- | src/game/Unit.cpp | 9 |
3 files changed, 25 insertions, 3 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 7c3fc42f32a..f086175987e 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -512,6 +512,8 @@ m_target(parentAura->GetTarget()), m_tickNumber(0) // Start periodic on next tick or at aura apply if (!(m_spellProto->AttributesEx5 & SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY)) m_periodicTimer += m_amplitude; + + m_isApplied = false; } AreaAuraEffect::AreaAuraEffect(Aura * parentAura, uint32 effIndex, int32 * currentBasePoints, Unit * caster, Item * castItem, Unit * source) @@ -3229,8 +3231,15 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun { if(form == FORM_CAT && apply) // add dash if in cat-from { - if(AuraEffect * aurEff =m_target->GetAura(SPELL_AURA_MOD_INCREASE_SPEED, SPELLFAMILY_DRUID, 0, 0, 0x8)) - m_target->HandleAuraEffect(aurEff, true); + Unit::AuraMap & auras = m_target->GetAuras(); + for (Unit::AuraMap::iterator iter = auras.begin(); iter != auras.end();++iter) + { + Aura * aur = iter->second; + if (aur->GetSpellProto()->SpellFamilyName==SPELLFAMILY_DRUID && aur->GetSpellProto()->SpellFamilyFlags[2] & 0x8) + { + m_target->HandleAuraEffect(aur->GetPartAura(0), true); + } + } } else // remove dash effect(not buff) if out of cat-from { @@ -4108,7 +4117,10 @@ void AuraEffect::HandleAuraModIncreaseSpeed(bool apply, bool Real, bool changeAm if(apply) // Dash wont work if you are not in cat form if(m_spellProto->SpellFamilyName==SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags[2] & 0x8 && m_target->m_form != FORM_CAT ) + { + m_target->HandleAuraEffect(this, false); return; + } m_target->UpdateSpeed(MOVE_RUN, true); } diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 9deb25772d4..1a4d0590af7 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -350,6 +350,8 @@ class TRINITY_DLL_SPEC AuraEffect bool IsAreaAura() const { return m_isAreaAura; } bool IsPeriodic() const { return m_isPeriodic; } bool IsPersistent() const { return m_isPersistent; } + bool IsApplied() const { return m_isApplied; } + void SetApplied (bool val) {m_isApplied = val; } bool isAffectedOnSpell(SpellEntry const *spell) const; void ApplyModifier(bool apply, bool Real = false, bool changeAmount=false); @@ -392,6 +394,7 @@ class TRINITY_DLL_SPEC AuraEffect bool m_isPeriodic:1; bool m_isAreaAura:1; bool m_isPersistent:1; + bool m_isApplied:1; }; class TRINITY_DLL_SPEC AreaAuraEffect : public AuraEffect diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index aca3ea92ce5..da2b53aec72 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -13104,7 +13104,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue( AuraEffect* triggeredByAura ) CastCustomSpell(target,spellProto->Id,&heal,NULL,NULL,true,NULL,triggeredByAura,caster->GetGUID()); if (Aura * aur = target->GetAura(spellProto->Id, caster->GetGUID())) aur->SetAuraCharges(jumps); - //caster->SpellHealingBonus(this, spellProto, heal, HEAL); + caster->SpellHealingBonus(this, spellProto, heal, HEAL); } } } @@ -13857,11 +13857,18 @@ void Unit::HandleAuraEffect(AuraEffect * aureff, bool apply) return; if (apply) { + if (aureff->IsApplied()) + return; + + aureff->SetApplied(true); m_modAuras[aureff->GetAuraName()].push_back(aureff); aureff->ApplyModifier(true, true); } else { + if (!aureff->IsApplied()) + return; + aureff->SetApplied(false); // remove from list before mods removing (prevent cyclic calls, mods added before including to aura list - use reverse order) m_modAuras[aureff->GetAuraName()].remove(aureff); aureff->ApplyModifier(false, true); |