Core/Creature: take HoverHeight into account when calculating ground height for flying, hovering or levitating creatures

This commit is contained in:
Ovahlord
2018-04-17 16:49:48 +02:00
parent bdd3b4f343
commit 3136de4850

View File

@@ -1671,6 +1671,13 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
if (z < ground_z)
z = ground_z;
}
// Creatures that are simulating flight effects or actual flight should use HoverHeight
if (ToUnit() && (ToUnit()->IsFlying() || ToUnit()->IsHovering() || ToUnit()->IsLevitating()))
{
uint32 hoverHeight = GetFloatValue(UNIT_FIELD_HOVERHEIGHT);
z += hoverHeight;
}
break;
}
case TYPEID_PLAYER: