From e811b9cdc2582cb1504e85b43d80696031fe2634 Mon Sep 17 00:00:00 2001 From: Ovah Date: Thu, 1 Oct 2020 04:41:08 +0200 Subject: Core/Movement: fix units falling through the ground when hover mode is disengaged (PR #25518) --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 8e682bc0cb0..78c79a7d173 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13243,7 +13243,7 @@ bool Unit::SetHover(bool enable, bool /*packetOnly = false*/, bool /*updateAnima //! Dying creatures will MoveFall from setDeathState if (hoverHeight && (!isDying() || GetTypeId() != TYPEID_UNIT)) { - float newZ = GetPositionZ() - hoverHeight; + float newZ = std::max(GetFloorZ(), GetPositionZ() - hoverHeight); UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), newZ); UpdateHeight(newZ); } -- cgit v1.2.3