fix(Core/Pet): Allow Pets to attack players from any angle (#24580)
This commit is contained in:
parent
f87752de24
commit
ebe11235d2
1 changed files with 5 additions and 3 deletions
|
|
@ -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)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue