From beff2a145c61f2d97f12f5f94736818243d4f201 Mon Sep 17 00:00:00 2001 From: Laise Date: Mon, 12 Jul 2010 20:28:51 +0300 Subject: [PATCH] [10185] fix auras adding to previously added holder --- src/game/Creature.cpp | 1 + src/game/GridNotifiersImpl.h | 1 + src/game/SpellAuras.cpp | 1 + src/game/Unit.cpp | 9 +++++++-- src/game/Unit.h | 1 + src/shared/revision_nr.h | 2 +- 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index ee759fda5..7d4c02538 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1827,6 +1827,7 @@ bool Creature::LoadCreaturesAddon(bool reload) if (addedToExisting) { + AddAuraToModList(AdditionalAura); holder->SetInUse(true); AdditionalAura->ApplyModifier(true,true); holder->SetInUse(false); diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 010c50a4e..a3440cdb3 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -187,6 +187,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target) if (addedToExisting) { + target->AddAuraToModList(Aur); holder->SetInUse(true); Aur->ApplyModifier(true,true); holder->SetInUse(false); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 00161a085..18b2e25e0 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -783,6 +783,7 @@ void AreaAura::Update(uint32 diff) if (addedToExisting) { + (*tIter)->AddAuraToModList(aur); holder->SetInUse(true); aur->ApplyModifier(true,true); holder->SetInUse(false); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e967701ff..b3ca0d021 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3981,8 +3981,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder *holder) for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) if (Aura *aur = holder->GetAuraByEffectIndex(SpellEffectIndex(i))) - if (aur->GetModifier()->m_auraname < TOTAL_AURAS) - m_modAuras[aur->GetModifier()->m_auraname].push_back(aur); + AddAuraToModList(aur); holder->ApplyAuraModifiers(true, true); DEBUG_LOG("Holder of spell %u now is in use", holder->GetId()); @@ -3997,6 +3996,12 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder *holder) return true; } +void Unit::AddAuraToModList(Aura *aura) +{ + if (aura->GetModifier()->m_auraname < TOTAL_AURAS) + m_modAuras[aura->GetModifier()->m_auraname].push_back(aura); +} + void Unit::RemoveRankAurasDueToSpell(uint32 spellId) { SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); diff --git a/src/game/Unit.h b/src/game/Unit.h index 35c3767af..1e8807003 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1504,6 +1504,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject bool CheckAllControlledUnits(Func const& func, bool withTotems, bool withGuardians, bool withCharms) const; bool AddSpellAuraHolder(SpellAuraHolder *holder); + void AddAuraToModList(Aura *aura); // removing specific aura stack void RemoveAura(Aura* aura, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index bf34af398..dadc38db6 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10184" + #define REVISION_NR "10185" #endif // __REVISION_NR_H__