Do not split self caused damage.

Do not split damage that is caused by yourself (mainly environmental damage).
This also fixes pets attacking their master when SL is active.
This commit is contained in:
hunuza 2008-11-02 17:53:27 +01:00
parent f2852a95b7
commit c6eadf5565

View file

@ -1652,6 +1652,9 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
RemainingDamage -= currentAbsorb;
}
// only split damage if not damaing yourself
if(pVictim != this)
{
AuraList const& vSplitDamageFlat = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_FLAT);
for(AuraList::const_iterator i = vSplitDamageFlat.begin(), next; i != vSplitDamageFlat.end() && RemainingDamage >= 0; i = next)
{
@ -1703,6 +1706,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
CleanDamage cleanDamage = CleanDamage(splitted, BASE_ATTACK, MELEE_HIT_NORMAL);
DealDamage(caster, splitted, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*i)->GetSpellProto(), false);
}
}
*absorb = damage - RemainingDamage - *resist;
}