aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChaouki Dhib <chaodhib@gmail.com>2018-02-28 13:40:41 +0100
committerfunjoker <funjoker109@gmail.com>2021-08-08 21:21:34 +0200
commit30cfe3741ab937057f87043a4ed089258d836323 (patch)
tree70cdc4eacdebd513d655e52081990d2883e031d4 /src
parent4b93059ec79f06effeeb4c164e426e0276b24193 (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. (cherry picked from commit 0fb133013c0c1c2c7f47c215435990822454d8f8)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/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 037b77d3982..0465c958990 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
@@ -71,10 +71,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)