[10185] fix auras adding to previously added holder

This commit is contained in:
Laise 2010-07-12 20:28:51 +03:00
parent 40c7356290
commit beff2a145c
6 changed files with 12 additions and 3 deletions

View file

@ -1827,6 +1827,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
if (addedToExisting) if (addedToExisting)
{ {
AddAuraToModList(AdditionalAura);
holder->SetInUse(true); holder->SetInUse(true);
AdditionalAura->ApplyModifier(true,true); AdditionalAura->ApplyModifier(true,true);
holder->SetInUse(false); holder->SetInUse(false);

View file

@ -187,6 +187,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
if (addedToExisting) if (addedToExisting)
{ {
target->AddAuraToModList(Aur);
holder->SetInUse(true); holder->SetInUse(true);
Aur->ApplyModifier(true,true); Aur->ApplyModifier(true,true);
holder->SetInUse(false); holder->SetInUse(false);

View file

@ -783,6 +783,7 @@ void AreaAura::Update(uint32 diff)
if (addedToExisting) if (addedToExisting)
{ {
(*tIter)->AddAuraToModList(aur);
holder->SetInUse(true); holder->SetInUse(true);
aur->ApplyModifier(true,true); aur->ApplyModifier(true,true);
holder->SetInUse(false); holder->SetInUse(false);

View file

@ -3981,8 +3981,7 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder *holder)
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
if (Aura *aur = holder->GetAuraByEffectIndex(SpellEffectIndex(i))) if (Aura *aur = holder->GetAuraByEffectIndex(SpellEffectIndex(i)))
if (aur->GetModifier()->m_auraname < TOTAL_AURAS) AddAuraToModList(aur);
m_modAuras[aur->GetModifier()->m_auraname].push_back(aur);
holder->ApplyAuraModifiers(true, true); holder->ApplyAuraModifiers(true, true);
DEBUG_LOG("Holder of spell %u now is in use", holder->GetId()); DEBUG_LOG("Holder of spell %u now is in use", holder->GetId());
@ -3997,6 +3996,12 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder *holder)
return true; 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) void Unit::RemoveRankAurasDueToSpell(uint32 spellId)
{ {
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);

View file

@ -1504,6 +1504,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
bool CheckAllControlledUnits(Func const& func, bool withTotems, bool withGuardians, bool withCharms) const; bool CheckAllControlledUnits(Func const& func, bool withTotems, bool withGuardians, bool withCharms) const;
bool AddSpellAuraHolder(SpellAuraHolder *holder); bool AddSpellAuraHolder(SpellAuraHolder *holder);
void AddAuraToModList(Aura *aura);
// removing specific aura stack // removing specific aura stack
void RemoveAura(Aura* aura, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); void RemoveAura(Aura* aura, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10184" #define REVISION_NR "10185"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__