aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/CoreAI/PetAI.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp
index f3f0596bb65..1ba08c3599d 100644
--- a/src/server/game/AI/CoreAI/PetAI.cpp
+++ b/src/server/game/AI/CoreAI/PetAI.cpp
@@ -420,8 +420,12 @@ void PetAI::DoAttack(Unit* target, bool chase)
if (me->HasUnitState(UNIT_STATE_FOLLOW))
me->GetMotionMaster()->Remove(FOLLOW_MOTION_TYPE);
-
- me->GetMotionMaster()->MoveChase(target, me->GetPetChaseDistance(), float(M_PI));
+
+ // Pets with ranged attacks should not care about the chase angle at all.
+ float chaseDistance = me->GetPetChaseDistance();
+ float angle = chaseDistance == 0.f ? float(M_PI) : 0.f;
+ float tolerance = chaseDistance == 0.f ? float(M_PI_4) : float(M_PI * 2);
+ me->GetMotionMaster()->MoveChase(target, ChaseRange(0.f, chaseDistance), ChaseAngle(angle, tolerance));
}
else // (Stay && ((Aggressive || Defensive) && In Melee Range)))
{