mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 09:39:11 +00:00
fix(Core/Combat): Pets should put their owners in combat only on init… (#14682)
This commit is contained in:
@@ -1064,7 +1064,7 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
||||
|
||||
if (attacker)
|
||||
{
|
||||
if (spellProto && !victim->IsInCombatWith(attacker))
|
||||
if (spellProto && victim->CanHaveThreatList() && !victim->HasUnitState(UNIT_STATE_EVADE) && !victim->IsInCombatWith(attacker))
|
||||
{
|
||||
victim->CombatStart(attacker, !(spellProto->AttributesEx3 & SPELL_ATTR3_SUPRESS_TARGET_PROCS));
|
||||
}
|
||||
@@ -13585,14 +13585,19 @@ void Unit::CombatStart(Unit* victim, bool initialAggro)
|
||||
}
|
||||
}
|
||||
|
||||
bool alreadyInCombat = IsInCombat();
|
||||
|
||||
SetInCombatWith(victim);
|
||||
victim->SetInCombatWith(this);
|
||||
|
||||
// Xinef: If pet started combat - put owner in combat
|
||||
if (Unit* owner = GetOwner())
|
||||
if (!alreadyInCombat && IsInCombat())
|
||||
{
|
||||
owner->SetInCombatWith(victim);
|
||||
victim->SetInCombatWith(owner);
|
||||
if (Unit* owner = GetOwner())
|
||||
{
|
||||
owner->SetInCombatWith(victim);
|
||||
victim->SetInCombatWith(owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user