Core/Movement: Correct distance checking

Distance checking should always be in 3D, independently on if the mover has the ability to fly or not.
This commit is contained in:
Chaouki Dhib
2018-02-28 13:40:41 +01:00
committed by Aokromes
parent 907e47804f
commit 81e7cb4c42

View File

@@ -72,10 +72,7 @@ bool TargetedMovementGenerator<T, D>::DoUpdate(T* owner, uint32 diff)
transport->CalculatePassengerPosition(destination.x, destination.y, destination.z);
// First check distance
if (owner->GetTypeId() == TYPEID_UNIT && 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)