fix(Core/Unit): Add melee leeway for auto attacks (#22566)

This commit is contained in:
Jelle Meeus
2025-07-29 05:58:30 -07:00
committed by GitHub
parent 67aa022dbf
commit 2e1f848f09
4 changed files with 12 additions and 1 deletions

View File

@@ -7109,7 +7109,7 @@ SpellCastResult Spell::CheckRange(bool strict)
if (range_type == SPELL_RANGE_MELEE)
{
float real_max_range = max_range;
if (!m_caster->IsCreature() && m_caster->isMoving() && target->isMoving() && !m_caster->IsWalking() && !target->IsWalking())
if (!m_caster->IsCreature() && m_caster->HasLeewayMovement() && target->HasLeewayMovement())
real_max_range -= MIN_MELEE_REACH; // Because of lag, we can not check too strictly here (is only used if both caster and target are moving)
else
real_max_range -= 2 * MIN_MELEE_REACH;