Core/Movement: Correct distance checking

Port From (https://github.com/TrinityCore/TrinityCore/commit/30cfe3741ab937057f87043a4ed089258d836323)
This commit is contained in:
hondacrx
2021-08-09 11:39:19 -04:00
parent f31d3ec432
commit fbf1a05485
@@ -88,11 +88,7 @@ namespace Game.Movement
}
// First check distance
if (owner.IsCreature() && owner.ToCreature().CanFly())
targetMoved = !GetTarget().IsInDist(destination.X, destination.Y, destination.Z, distance);
else
targetMoved = !GetTarget().IsInDist2d(destination.X, destination.Y, distance);
targetMoved = !GetTarget().IsInDist(destination.X, destination.Y, destination.Z, distance);
// then, if the target is in range, check also Line of Sight.
if (!targetMoved)