set pet react state to defensive during attack

This commit is contained in:
Yunfan Li
2023-07-14 16:33:41 +08:00
parent 01d4121ff8
commit 63573b5c7e

View File

@@ -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();