diff options
| author | QAston <none@none> | 2010-01-10 12:08:58 +0100 |
|---|---|---|
| committer | QAston <none@none> | 2010-01-10 12:08:58 +0100 |
| commit | e3ff6145eec7e72299d4223714e98048643c5c75 (patch) | |
| tree | d14c33aac335e9fa15122c67ea8a65323fd2639f /src/game/Unit.cpp | |
| parent | 6cbe65eaa3391a5b524583b18b4dace03b8dcb2c (diff) | |
* 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
Diffstat (limited to 'src/game/Unit.cpp')
| -rw-r--r-- | src/game/Unit.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b31a406e185..195bc6230ee 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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]; |
