Core/Units: Correct Z coord change when enabling hover above ground

(cherry picked from commit 8d49be5e1cb84e26b93fa2cde415b3eba9353164)
This commit is contained in:
Shauren
2026-06-28 15:12:02 +02:00
parent ad0c5287cf
commit 7c3d56a9b2
+1 -1
View File
@@ -13601,7 +13601,7 @@ bool Unit::SetHover(bool enable, bool updateAnimTier /*= true*/)
//! No need to check height on ascent //! No need to check height on ascent
AddUnitMovementFlag(MOVEMENTFLAG_HOVER); AddUnitMovementFlag(MOVEMENTFLAG_HOVER);
if (hoverHeight && GetPositionZ() - GetFloorZ() < hoverHeight) if (hoverHeight && GetPositionZ() - GetFloorZ() < hoverHeight)
UpdateHeight(GetPositionZ() + hoverHeight); UpdateHeight(std::max(GetFloorZ() + hoverHeight, GetPositionZ()));
} }
else else
{ {