mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-03 11:03:47 +00:00
fix(Core/Pets): Manual using pet spell should not reset attack command. (#9635)
Fixes #9632
This commit is contained in:
@@ -593,16 +593,12 @@ void PetAI::DoAttack(Unit* target, bool chase)
|
||||
if (me->HasReactState(REACT_AGGRESSIVE) && !me->GetCharmInfo()->IsCommandAttack())
|
||||
me->SendPetAIReaction(me->GetGUID());
|
||||
|
||||
if (CharmInfo* ci = me->GetCharmInfo())
|
||||
{
|
||||
ci->SetIsAtStay(false);
|
||||
ci->SetIsCommandFollow(false);
|
||||
ci->SetIsFollowing(false);
|
||||
ci->SetIsReturning(false);
|
||||
}
|
||||
|
||||
if (chase)
|
||||
{
|
||||
bool oldCmdAttack = me->GetCharmInfo()->IsCommandAttack(); // This needs to be reset after other flags are cleared
|
||||
ClearCharmInfoFlags();
|
||||
me->GetCharmInfo()->SetIsCommandAttack(oldCmdAttack); // For passive pets commanded to attack so they will use spells
|
||||
|
||||
if (_canMeleeAttack())
|
||||
{
|
||||
float angle = combatRange == 0.f && target->GetTypeId() != TYPEID_PLAYER && !target->IsPet() ? float(M_PI) : 0.f;
|
||||
@@ -612,6 +608,8 @@ void PetAI::DoAttack(Unit* target, bool chase)
|
||||
}
|
||||
else // (Stay && ((Aggressive || Defensive) && In Melee Range)))
|
||||
{
|
||||
ClearCharmInfoFlags();
|
||||
|
||||
me->GetCharmInfo()->SetIsAtStay(true);
|
||||
me->GetMotionMaster()->MovementExpiredOnSlot(MOTION_SLOT_ACTIVE, false);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
|
||||
Reference in New Issue
Block a user