Core/Units: do not take hover height into account for creatures that are underwater

This commit is contained in:
Ovahlord
2018-04-24 23:26:43 +02:00
parent 0c85670585
commit ef129a851c

View File

@@ -1673,7 +1673,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
}
// Creatures that are simulating flight effects or actual flight should use HoverHeight
if (ToUnit() && (ToUnit()->IsFlying() || ToUnit()->IsHovering() || ToUnit()->IsLevitating()))
if ((ToUnit() && (ToUnit()->IsFlying() || ToUnit()->IsHovering() || ToUnit()->IsLevitating())) && !ToUnit()->IsUnderWater())
{
uint32 hoverHeight = GetFloatValue(UNIT_FIELD_HOVERHEIGHT);
z += hoverHeight;