Core/Creatures: Enable swimming creatures to chase targets in 3d (#18298)

Closes #11060
This commit is contained in:
Krudor
2016-11-23 09:10:15 +01:00
committed by Aokromes
parent 2f1910476e
commit 64763f86de

View File

@@ -183,7 +183,7 @@ bool TargetedMovementGeneratorMedium<T, D>::DoUpdate(T* owner, uint32 time_diff)
transport->CalculatePassengerPosition(dest.x, dest.y, dest.z);
// First check distance
if (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->CanFly())
if (owner->GetTypeId() == TYPEID_UNIT && (owner->ToCreature()->CanFly() || owner->ToCreature()->CanSwim()))
targetMoved = !i_target->IsWithinDist3d(dest.x, dest.y, dest.z, allowed_dist);
else
targetMoved = !i_target->IsWithinDist2d(dest.x, dest.y, allowed_dist);