mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
fix(Core/Unit): Add melee leeway for auto attacks (#22566)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user