mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user