Core/Auras: Prevent possible crash on SPELL_AURA_DAMAGE_SHIELD aura handler.
This commit is contained in:
@@ -1390,8 +1390,10 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
|
||||
// Do effect if any damage done to target
|
||||
if (damageInfo->damage)
|
||||
{
|
||||
AuraEffectList const& vDamageShields = pVictim->GetAuraEffectsByType(SPELL_AURA_DAMAGE_SHIELD);
|
||||
for (AuraEffectList::const_iterator dmgShieldItr = vDamageShields.begin(); dmgShieldItr != vDamageShields.end(); ++dmgShieldItr)
|
||||
// We're going to call functions which can modify content of the list during iteration over it's elements
|
||||
// Let's copy the list so we can prevent iterator invalidation
|
||||
AuraEffectList vDamageShieldsCopy(pVictim->GetAuraEffectsByType(SPELL_AURA_DAMAGE_SHIELD));
|
||||
for (AuraEffectList::const_iterator dmgShieldItr = vDamageShieldsCopy.begin(); dmgShieldItr != vDamageShieldsCopy.end(); ++dmgShieldItr)
|
||||
{
|
||||
SpellEntry const *i_spellProto = (*dmgShieldItr)->GetSpellProto();
|
||||
// Damage shield can be resisted...
|
||||
|
||||
Reference in New Issue
Block a user