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

@@ -674,6 +674,9 @@ bool Unit::IsWithinMeleeRange(Unit const* obj, float dist) const
float maxdist = dist + GetMeleeRange(obj);
if ((IsPlayer() || obj->IsPlayer()) && HasLeewayMovement() && obj->HasLeewayMovement())
maxdist += LEEWAY_BONUS_RANGE;
return distsq < maxdist * maxdist;
}