diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1d38c35b4..988f82283 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4611,6 +4611,11 @@ void Unit::RemoveAura(Aura *Aur, AuraRemoveMode mode) DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Aura %u now is remove mode %d",Aur->GetModifier()->m_auraname, mode); + // aura _MUST_ be remove from holder before unapply. + // un-apply code expected that aura not find by diff searches + // in another case it can be double removed for example, if target die/etc in un-apply process. + Aur->GetHolder()->RemoveAura(Aur->GetEffIndex()); + // some auras also need to apply modifier (on caster) on remove if (mode == AURA_REMOVE_BY_DELETE) { @@ -4628,22 +4633,12 @@ void Unit::RemoveAura(Aura *Aur, AuraRemoveMode mode) else Aur->ApplyModifier(false,true); - Aur->GetHolder()->RemoveAura(Aur->GetEffIndex()); - // If aura in use (removed from code that plan access to it data after return) // store it in aura list with delayed deletion if (Aur->IsInUse()) m_deletedAuras.push_back(Aur); else delete Aur; - - - // only way correctly remove all auras from list - /*if( m_Auras.empty() ) - i = m_Auras.end(); - else - i = m_Auras.begin();*/ - } void Unit::RemoveAllAuras(AuraRemoveMode mode /*= AURA_REMOVE_BY_DEFAULT*/) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e857eaf82..4f86007ff 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 "10286" + #define REVISION_NR "10287" #endif // __REVISION_NR_H__