[10987] Prevent deleting reflect source aura ebfore reflected spell cast.

This commit is contained in:
VladimirMangos 2011-01-09 00:52:13 +03:00
parent 287229bfdb
commit 6e241689e7
2 changed files with 7 additions and 1 deletions

View file

@ -2055,6 +2055,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit *pCaster, SpellSchoolMask schoolM
reflectDamage = currentAbsorb / 2;
reflectSpell = 33619;
reflectTriggeredBy = *i;
reflectTriggeredBy->SetInUse(true); // lock aura from final deletion until processing
break;
}
if (spellProto->Id == 39228 || // Argussian Compass
@ -2130,6 +2131,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit *pCaster, SpellSchoolMask schoolM
reflectDamage = (*k)->GetModifier()->m_amount * RemainingDamage/100;
reflectSpell = 33619;
reflectTriggeredBy = *i;
reflectTriggeredBy->SetInUse(true);// lock aura from final deletion until processing
} break;
default: break;
}
@ -2237,7 +2239,11 @@ void Unit::CalculateDamageAbsorbAndResist(Unit *pCaster, SpellSchoolMask schoolM
// Cast back reflect damage spell
if (canReflect && reflectSpell)
{
CastCustomSpell(pCaster, reflectSpell, &reflectDamage, NULL, NULL, true, NULL, reflectTriggeredBy);
reflectTriggeredBy->SetInUse(false); // free lock from deletion
}
// absorb by mana cost
AuraList const& vManaShield = GetAurasByType(SPELL_AURA_MANA_SHIELD);