aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChaouki Dhib <chaodhib@gmail.com>2018-02-28 13:40:41 +0100
committerGitHub <noreply@github.com>2018-02-28 13:40:41 +0100
commit0fb133013c0c1c2c7f47c215435990822454d8f8 (patch)
tree108be3f745480d90c9ebd3b01ace2efad47be88d
parent9fc6b13027d2d66a99b6bee49d3add23f2c0c8af (diff)
Core/Movement: Correct distance checking
Distance checking should always be in 3D, independently on if the mover has the ability to fly or not.
-rw-r--r--src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
index 2321682e7b3..de0a16e1910 100644
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
@@ -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)