fix(Core/Combat): Fix guardians not attacking after threat system port (#25157)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
@@ -306,6 +306,8 @@ struct npc_pet_dk_army_of_the_dead : public AggressorAI
|
||||
{
|
||||
npc_pet_dk_army_of_the_dead(Creature* creature) : AggressorAI(creature) { }
|
||||
|
||||
// Restrict MoveInLineOfSight aggro to targets already fighting our owner,
|
||||
// so ghouls don't pull extra packs on their own.
|
||||
bool CanAIAttack(Unit const* target) const override
|
||||
{
|
||||
if (!target)
|
||||
@@ -315,6 +317,26 @@ struct npc_pet_dk_army_of_the_dead : public AggressorAI
|
||||
return false;
|
||||
return AggressorAI::CanAIAttack(target);
|
||||
}
|
||||
|
||||
// Owner started attacking a target — engage immediately.
|
||||
// We bypass OnOwnerCombatInteraction because CanStartAttack -> CanAIAttack
|
||||
// may reject the target before combat refs are established.
|
||||
void OwnerAttacked(Unit* target) override
|
||||
{
|
||||
if (!target || !me->IsAlive() || me->HasReactState(REACT_PASSIVE))
|
||||
return;
|
||||
if (me->IsValidAttackTarget(target))
|
||||
AttackStart(target);
|
||||
}
|
||||
|
||||
// Owner was attacked — help defend.
|
||||
void OwnerAttackedBy(Unit* attacker) override
|
||||
{
|
||||
if (!attacker || !me->IsAlive() || me->HasReactState(REACT_PASSIVE))
|
||||
return;
|
||||
if (me->IsValidAttackTarget(attacker))
|
||||
AttackStart(attacker);
|
||||
}
|
||||
};
|
||||
|
||||
struct npc_pet_dk_dancing_rune_weapon : public NullCreatureAI
|
||||
|
||||
Reference in New Issue
Block a user