fix(Core/Player): allow attacking target within boundary radius when… (#22500)

Co-authored-by: Kito <kito@vortexirc.com>
This commit is contained in:
Jelle Meeus
2025-07-29 05:38:49 -07:00
committed by GitHub
parent 98eda3684d
commit 40c58123b1
4 changed files with 18 additions and 6 deletions

View File

@@ -181,8 +181,8 @@ void Player::Update(uint32 p_time)
m_swingErrorMsg = 1;
}
}
// 120 degrees of radiant range
else if (!HasInArc(2 * M_PI / 3, victim))
// 120 degrees of radiant range, if player is not in boundary radius
else if (!IsWithinBoundaryRadius(victim) && !HasInArc(2 * float(M_PI) / 3, victim))
{
setAttackTimer(BASE_ATTACK, 100);
if (m_swingErrorMsg != 2) // send single time (client auto repeat)
@@ -211,8 +211,8 @@ void Player::Update(uint32 p_time)
{
if (!IsWithinMeleeRange(victim))
setAttackTimer(OFF_ATTACK, 100);
else if (!HasInArc(2 * M_PI / 3, victim))
setAttackTimer(OFF_ATTACK, 100);
else if (!IsWithinBoundaryRadius(victim) && !HasInArc(2 * float(M_PI) / 3, victim))
setAttackTimer(BASE_ATTACK, 100);
else
{
// prevent base and off attack in same time, delay attack at