mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
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:
parent
f2852a95b7
commit
c6eadf5565
1 changed files with 40 additions and 36 deletions
|
|
@ -1652,6 +1652,9 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
|
||||||
RemainingDamage -= currentAbsorb;
|
RemainingDamage -= currentAbsorb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only split damage if not damaing yourself
|
||||||
|
if(pVictim != this)
|
||||||
|
{
|
||||||
AuraList const& vSplitDamageFlat = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_FLAT);
|
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)
|
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);
|
CleanDamage cleanDamage = CleanDamage(splitted, BASE_ATTACK, MELEE_HIT_NORMAL);
|
||||||
DealDamage(caster, splitted, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*i)->GetSpellProto(), false);
|
DealDamage(caster, splitted, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*i)->GetSpellProto(), false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*absorb = damage - RemainingDamage - *resist;
|
*absorb = damage - RemainingDamage - *resist;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue