fix(Core/Unit): prevent creature triggering combat from self damage (#23245)
This commit is contained in:
@@ -1086,12 +1086,10 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
|||||||
if (damagetype != DOT && damage > 0 && !victim->GetOwnerGUID().IsPlayer() && (!spellProto || !spellProto->HasAura(SPELL_AURA_DAMAGE_SHIELD)))
|
if (damagetype != DOT && damage > 0 && !victim->GetOwnerGUID().IsPlayer() && (!spellProto || !spellProto->HasAura(SPELL_AURA_DAMAGE_SHIELD)))
|
||||||
victim->ToCreature()->UpdateLeashExtensionTime();
|
victim->ToCreature()->UpdateLeashExtensionTime();
|
||||||
|
|
||||||
if (attacker)
|
if (attacker && attacker != victim)
|
||||||
{
|
{
|
||||||
if (spellProto && victim->CanHaveThreatList() && !victim->HasUnitState(UNIT_STATE_EVADE) && !victim->IsInCombatWith(attacker))
|
if (spellProto && victim->CanHaveThreatList() && !victim->HasUnitState(UNIT_STATE_EVADE) && !victim->IsInCombatWith(attacker))
|
||||||
{
|
|
||||||
victim->CombatStart(attacker, !(spellProto->AttributesEx3 & SPELL_ATTR3_SUPPRESS_TARGET_PROCS));
|
victim->CombatStart(attacker, !(spellProto->AttributesEx3 & SPELL_ATTR3_SUPPRESS_TARGET_PROCS));
|
||||||
}
|
|
||||||
|
|
||||||
victim->AddThreat(attacker, float(damage), damageSchoolMask, spellProto);
|
victim->AddThreat(attacker, float(damage), damageSchoolMask, spellProto);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user