mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +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 (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));
|
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);
|
SetInCombatWith(victim);
|
||||||
victim->SetInCombatWith(this);
|
victim->SetInCombatWith(this);
|
||||||
|
|
||||||
// Xinef: If pet started combat - put owner in combat
|
// Xinef: If pet started combat - put owner in combat
|
||||||
if (Unit* owner = GetOwner())
|
if (!alreadyInCombat && IsInCombat())
|
||||||
{
|
{
|
||||||
owner->SetInCombatWith(victim);
|
if (Unit* owner = GetOwner())
|
||||||
victim->SetInCombatWith(owner);
|
{
|
||||||
|
owner->SetInCombatWith(victim);
|
||||||
|
victim->SetInCombatWith(owner);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user