mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10287] Fixed crash in result double deleting auras in some cases.
Pre-aura holder code always remove auras from diff lists before un-apply aura affect call. Restore this way work for new aura holder code. This prevent different strange affects when aura find by search when it already expected to be removed from target, including case when in result som un-apply called code aura deleted 2 times.
This commit is contained in:
parent
119e97a1a1
commit
ed737c55cd
2 changed files with 6 additions and 11 deletions
|
|
@ -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*/)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10286"
|
||||
#define REVISION_NR "10287"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue