From 63573b5c7ecea37b060fdff2d8ee6e453b86a01f Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Fri, 14 Jul 2023 16:33:41 +0800 Subject: [PATCH] set pet react state to defensive during attack --- src/strategy/actions/AttackAction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/strategy/actions/AttackAction.cpp b/src/strategy/actions/AttackAction.cpp index 1cff464c..7625eb3f 100644 --- a/src/strategy/actions/AttackAction.cpp +++ b/src/strategy/actions/AttackAction.cpp @@ -104,13 +104,15 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/) if (Pet* pet = bot->GetPet()) { - pet->SetReactState(REACT_PASSIVE); + if (with_pet) { + pet->SetReactState(REACT_DEFENSIVE); pet->SetTarget(target->GetGUID()); pet->GetCharmInfo()->SetCommandState(COMMAND_ATTACK); pet->GetCharmInfo()->SetIsCommandAttack(true); pet->AI()->AttackStart(target); } else { + pet->SetReactState(REACT_PASSIVE); pet->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW); pet->GetCharmInfo()->SetIsCommandFollow(true); pet->GetCharmInfo()->IsReturning();