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())
|
||||
{
|
||||
float angle = combatRange == 0.f && !target->IsPlayer() && !target->IsPet() ? float(M_PI) : 0.f;
|
||||
float tolerance = combatRange == 0.f ? float(M_PI_4) : float(M_PI * 2);
|
||||
me->GetMotionMaster()->MoveChase(target, ChaseRange(0.f, combatRange), ChaseAngle(angle, tolerance));
|
||||
std::optional<ChaseAngle> chaseAngle;
|
||||
if (combatRange == 0.f && !target->IsPlayer() && !target->IsPet())
|
||||
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)))
|
||||
|
||||
Reference in New Issue
Block a user