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

Closes #11060
This commit is contained in:
Krudor authored and Aokromes committed 2016-11-23 11:18:06 +01:00
1 parent 2f1910476e
commit 64763f86de
1 file changed
+1 -1
@@ -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);