mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-05 08:28:57 +01:00
Fixed pets repositioning themselves after every cast (#23923)
This commit is contained in:
@@ -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)))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user