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
|
// Do effect if any damage done to target
|
||||||
if (damageInfo->damage)
|
if (damageInfo->damage)
|
||||||
{
|
{
|
||||||
AuraEffectList const& vDamageShields = pVictim->GetAuraEffectsByType(SPELL_AURA_DAMAGE_SHIELD);
|
// We're going to call functions which can modify content of the list during iteration over it's elements
|
||||||
for (AuraEffectList::const_iterator dmgShieldItr = vDamageShields.begin(); dmgShieldItr != vDamageShields.end(); ++dmgShieldItr)
|
// 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();
|
SpellEntry const *i_spellProto = (*dmgShieldItr)->GetSpellProto();
|
||||||
// Damage shield can be resisted...
|
// Damage shield can be resisted...
|
||||||
|
|||||||
Reference in New Issue
Block a user