mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Core/Creature: take HoverHeight into account when calculating ground height for flying, hovering or levitating creatures
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user