fix(Core/Spells): Make sure that attacker is always in combat with it… (#12516)

fix(Core/Spells): Make sure that attacker is always in combat with its victim when dealing damage/generating threat done by spells.

Fixes #10801
This commit is contained in:
UltraNix
2022-07-25 21:34:21 +02:00
committed by GitHub
parent 7aea91fcb3
commit c19d6b74e9

View File

@@ -1033,7 +1033,14 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
victim->ToCreature()->SetLastDamagedTime(GameTime::GetGameTime().count() + MAX_AGGRO_RESET_TIME);
if (attacker)
{
if (spellProto && !victim->IsInCombatWith(attacker))
{
victim->CombatStart(attacker, !(spellProto->AttributesEx3 & SPELL_ATTR3_SUPRESS_TARGET_PROCS));
}
victim->AddThreat(attacker, float(damage), damageSchoolMask, spellProto);
}
}
else // victim is a player
{