From e89495a40d311966574352b63ffa4cbc26ed1723 Mon Sep 17 00:00:00 2001 From: Michael Serajnik Date: Sat, 4 Apr 2026 00:55:13 +0200 Subject: [PATCH 1/4] Fix Imp Fire Shield owner targeting while grouped. --- src/game/AI/PetAI.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/game/AI/PetAI.cpp b/src/game/AI/PetAI.cpp index 20ee626d390..a0ca810a487 100644 --- a/src/game/AI/PetAI.cpp +++ b/src/game/AI/PetAI.cpp @@ -366,12 +366,14 @@ void PetAI::UpdateAllies() return; //owner is in group; group members filled in already (no raid -> subgroupcount = whole count) - if (group && !group->isRaidGroup() && m_AllySet.size() == (group->GetMembersCount() + 2)) + if (group && !group->isRaidGroup() && m_AllySet.size() == (group->GetMembersCount() + 1)) return; m_AllySet.clear(); m_AllySet.insert(m_creature->GetObjectGuid()); - if (group) //add group + m_AllySet.insert(owner->GetObjectGuid()); // Owner must always be a valid friendly autocast target + + if (group) { for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next()) { @@ -385,8 +387,6 @@ void PetAI::UpdateAllies() m_AllySet.insert(target->GetObjectGuid()); } } - else //remove group - m_AllySet.insert(owner->GetObjectGuid()); } void PetAI::KilledUnit(Unit* victim) @@ -523,7 +523,7 @@ std::pair PetAI::SelectNextTarget() const Unit* owner = m_creature->GetCharmerOrOwner(); if (!owner) return std::make_pair(nullptr, PSTR_FAIL_NO_OWNER); - + if (Creature const* pOwnerCreature = owner->ToCreature()) { // Owner is creature and is evading. We must not re-aggro. @@ -552,7 +552,7 @@ std::pair PetAI::SelectNextTarget() const { if (Unit* pVictim = owner->GetVictim()) { - if (!pVictim->HasAuraPetShouldAvoidBreaking() && + if (!pVictim->HasAuraPetShouldAvoidBreaking() && (!m_creature->GetCharmInfo()->IsAtStay() || m_creature->CanReachWithMeleeAutoAttack(pVictim))) return std::make_pair(pVictim, PSTR_SUCCESS_OWNER_VICTIM); } @@ -727,7 +727,7 @@ bool PetAI::CanAttack(Unit* target) // CC - mobs under crowd control can be attacked if owner commanded if (target->HasAuraPetShouldAvoidBreaking()) return m_creature->GetCharmInfo()->IsCommandAttack(); - + // Returning - pets ignore attacks only if owner clicked follow if (m_creature->GetCharmInfo()->IsReturning()) return !m_creature->GetCharmInfo()->IsCommandFollow(); @@ -801,4 +801,3 @@ void PetAI::AttackedBy(Unit* attacker) // Continue to evaluate and attack if necessary AttackStart(attacker); } - From 0eeacbc96a614a63797933e3483aa5dde08e04b3 Mon Sep 17 00:00:00 2001 From: Michael Serajnik Date: Sat, 4 Apr 2026 12:16:23 +0200 Subject: [PATCH 2/4] Remove explicit "autocast" mention from comment. --- src/game/AI/PetAI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/AI/PetAI.cpp b/src/game/AI/PetAI.cpp index a0ca810a487..5c9996dd5f6 100644 --- a/src/game/AI/PetAI.cpp +++ b/src/game/AI/PetAI.cpp @@ -371,7 +371,7 @@ void PetAI::UpdateAllies() m_AllySet.clear(); m_AllySet.insert(m_creature->GetObjectGuid()); - m_AllySet.insert(owner->GetObjectGuid()); // Owner must always be a valid friendly autocast target + m_AllySet.insert(owner->GetObjectGuid()); // Owner must always be a valid friendly target if (group) { From 264f32a2120d65a3fe049cfbf02bdc66e7663ecc Mon Sep 17 00:00:00 2001 From: Michael Serajnik Date: Mon, 6 Apr 2026 23:46:59 +0200 Subject: [PATCH 3/4] Refine comment wording. --- src/game/AI/PetAI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/AI/PetAI.cpp b/src/game/AI/PetAI.cpp index 5c9996dd5f6..704c7c5e35a 100644 --- a/src/game/AI/PetAI.cpp +++ b/src/game/AI/PetAI.cpp @@ -371,7 +371,7 @@ void PetAI::UpdateAllies() m_AllySet.clear(); m_AllySet.insert(m_creature->GetObjectGuid()); - m_AllySet.insert(owner->GetObjectGuid()); // Owner must always be a valid friendly target + m_AllySet.insert(owner->GetObjectGuid()); // The pet owner must always be a valid friendly target. if (group) { From 656807e797316dc463b15318192572e9921ac97c Mon Sep 17 00:00:00 2001 From: Michael Serajnik Date: Wed, 8 Apr 2026 12:49:58 +0200 Subject: [PATCH 4/4] Add comment about charmed handling. --- src/game/AI/PetAI.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/AI/PetAI.cpp b/src/game/AI/PetAI.cpp index 704c7c5e35a..e787d26c427 100644 --- a/src/game/AI/PetAI.cpp +++ b/src/game/AI/PetAI.cpp @@ -369,9 +369,11 @@ void PetAI::UpdateAllies() if (group && !group->isRaidGroup() && m_AllySet.size() == (group->GetMembersCount() + 1)) return; + // Cache potential friendly targets here. Charmed owner/group members are + // filtered later by spell target validation before the pet actually casts. m_AllySet.clear(); m_AllySet.insert(m_creature->GetObjectGuid()); - m_AllySet.insert(owner->GetObjectGuid()); // The pet owner must always be a valid friendly target. + m_AllySet.insert(owner->GetObjectGuid()); // The pet owner must always be included. if (group) {