From 3136de4850c8cb538795b803cd3aec06a41ef83a Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Tue, 17 Apr 2018 16:49:48 +0200 Subject: [PATCH] Core/Creature: take HoverHeight into account when calculating ground height for flying, hovering or levitating creatures --- src/server/game/Entities/Object/Object.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 795587c1f49..ee3af2f8431 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -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: