fix(Core/Unit): improve leeway bonus range and speed calculations (#25958)

Co-authored-by: GuybrushGit <turinpt3@gmail.com>
Co-authored-by: lightshope <lh@lightshope.org>
Co-authored-by: sidsukana <pgsilent@gmail.com>
Co-authored-by: ratkosrb <ratkomladic2@abv.bg>
This commit is contained in:
sogladev
2026-06-30 18:29:28 +02:00
committed by GitHub
parent 2f13ace75f
commit 7a66aa94c1
5 changed files with 74 additions and 11 deletions

View File

@@ -792,8 +792,7 @@ 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;
maxdist += GetLeewayBonusRange(obj);
return distsq < maxdist * maxdist;
}