From d85b562629b84f6f851a981985a4c21162d8f143 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Tue, 30 May 2023 01:06:23 +0800 Subject: [PATCH] pet related --- src/strategy/actions/FollowActions.cpp | 2 ++ src/strategy/actions/MovementActions.cpp | 2 ++ src/strategy/triggers/GenericTriggers.cpp | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/strategy/actions/FollowActions.cpp b/src/strategy/actions/FollowActions.cpp index a457028e..0c36c62d 100644 --- a/src/strategy/actions/FollowActions.cpp +++ b/src/strategy/actions/FollowActions.cpp @@ -35,6 +35,8 @@ bool FollowAction::Execute(Event event) pet->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW); pet->GetCharmInfo()->SetIsFollowing(true); pet->AttackStop(); + pet->GetCharmInfo()->IsReturning(); + pet->GetMotionMaster()->MoveFollow(bot, PET_FOLLOW_DIST, pet->GetFollowAngle()); } } //if (moved) diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index d9faa7e9..7274317d 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -1237,6 +1237,8 @@ bool FleeWithPetAction::Execute(Event event) pet->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW); pet->GetCharmInfo()->SetIsFollowing(true); pet->AttackStop(); + pet->GetCharmInfo()->IsReturning(); + pet->GetMotionMaster()->MoveFollow(bot, PET_FOLLOW_DIST, pet->GetFollowAngle()); } } diff --git a/src/strategy/triggers/GenericTriggers.cpp b/src/strategy/triggers/GenericTriggers.cpp index 25ddd2b2..d661a82c 100644 --- a/src/strategy/triggers/GenericTriggers.cpp +++ b/src/strategy/triggers/GenericTriggers.cpp @@ -18,11 +18,11 @@ bool MediumManaTrigger::IsActive() bool NoPetTrigger::IsActive() { - return !AI_VALUE(Unit*, "pet target") && !AI_VALUE2(bool, "mounted", "self target"); + return !AI_VALUE(Unit*, "pet target") && !bot->GetGuardianPet() && !AI_VALUE2(bool, "mounted", "self target"); } bool HasPetTrigger::IsActive() { - return AI_VALUE(Unit*, "pet target") && !AI_VALUE2(bool, "mounted", "self target");; + return (AI_VALUE(Unit*, "pet target") || bot->GetGuardianPet()) && !AI_VALUE2(bool, "mounted", "self target");; } bool HighManaTrigger::IsActive()