fix(Core/Pet): Allow Pets to attack players from any angle (#24580)

This commit is contained in:
Gultask
2026-02-06 18:06:13 -03:00
committed by GitHub
parent f87752de24
commit ebe11235d2

View File

@@ -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)))