* Use pair<uint32, uint64> lists instead of <Aura*> lists in Dispel/SpellSteal effects handlers (prevent reference to aura removed from unit)

* Correctly fill EffectStealBeneficialBuff list with Stackable/Chargeable auras

--HG--
branch : trunk
This commit is contained in:
QAston committed 2010-01-10 12:08:58 +01:00
1 parent 6cbe65eaa3
commit e3ff6145ee
3 files changed
+26 -30

No files matched your search

+6 -14
View File
@@ -3977,16 +3977,12 @@ inline void Unit::RemoveAuraFromStack(AuraMap::iterator &iter, AuraRemoveMode re
RemoveOwnedAura(iter, removeMode);
}
void Unit::RemoveAurasDueToSpellByDispel(Aura * aura, Unit *dispeller)
void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeller)
{
if (aura->IsRemoved())
return;
uint32 spellId = aura->GetId();
for (AuraMap::iterator iter = m_ownedAuras.lower_bound(spellId); iter != m_ownedAuras.upper_bound(spellId);)
{
if (aura == iter->second)
Aura * aura = iter->second;
if (aura->GetCasterGUID() == casterGUID)
{
if (aura->GetSpellProto()->AttributesEx7 & SPELL_ATTR_EX7_DISPEL_CHARGES)
aura->DropCharge();
@@ -4039,16 +4035,12 @@ void Unit::RemoveAurasDueToSpellByDispel(Aura * aura, Unit *dispeller)
}
}
void Unit::RemoveAurasDueToSpellBySteal(Aura * aura, Unit *stealer)
void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer)
{
if (aura->IsRemoved())
return;
uint32 spellId = aura->GetId();
for (AuraMap::iterator iter = m_ownedAuras.lower_bound(spellId); iter != m_ownedAuras.upper_bound(spellId);)
{
if (aura == iter->second)
Aura * aura = iter->second;
if (aura->GetCasterGUID() == casterGUID)
{
int32 damage[MAX_SPELL_EFFECTS];
int32 baseDamage[MAX_SPELL_EFFECTS];