mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-28 14:35:57 +00:00
fix(Core/Pet): Allow Pets to attack players from any angle (#24580)
This commit is contained in:
@@ -634,9 +634,11 @@ void PetAI::DoAttack(Unit* target, bool chase)
|
|||||||
|
|
||||||
if (_canMeleeAttack())
|
if (_canMeleeAttack())
|
||||||
{
|
{
|
||||||
float angle = combatRange == 0.f && !target->IsPlayer() && !target->IsPet() ? float(M_PI) : 0.f;
|
std::optional<ChaseAngle> chaseAngle;
|
||||||
float tolerance = combatRange == 0.f ? float(M_PI_4) : float(M_PI * 2);
|
if (combatRange == 0.f && !target->IsPlayer() && !target->IsPet())
|
||||||
me->GetMotionMaster()->MoveChase(target, ChaseRange(0.f, combatRange), ChaseAngle(angle, tolerance));
|
chaseAngle.emplace(float(M_PI), float(M_PI_4));
|
||||||
|
|
||||||
|
me->GetMotionMaster()->MoveChase(target, ChaseRange(0.f, combatRange), chaseAngle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // (Stay && ((Aggressive || Defensive) && In Melee Range)))
|
else // (Stay && ((Aggressive || Defensive) && In Melee Range)))
|
||||||
|
|||||||
Reference in New Issue
Block a user