fix(Core/Creature): Notify creature pets when owner enters combat via assist (#25327)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-06-26 00:21:16 -05:00
committed by GitHub
parent 27e4ad8725
commit 60e9b53589

View File

@@ -2874,6 +2874,13 @@ void Creature::AtEngage(Unit* target)
UpdateSpeed(MOVE_FLIGHT, true);
}
// Notify controlled creatures (guardians/pets) so they assist when
// the owner enters combat via assist/aggro chain, not only via damage.
for (Unit* controlled : m_Controlled)
if (Creature* cControlled = controlled->ToCreature())
if (CreatureAI* controlledAI = cControlled->AI())
controlledAI->OwnerAttackedBy(target);
MovementGeneratorType const movetype = GetMotionMaster()->GetCurrentMovementGeneratorType();
if (movetype == WAYPOINT_MOTION_TYPE || movetype == ESCORT_MOTION_TYPE || (IsAIEnabled && AI()->IsEscorted()))
{