From 85766a168ca14186cee818b1bd78d035673a41dc Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 24 May 2022 12:48:37 -0400 Subject: [PATCH] Core/Movement: fix units falling through the ground when hover mode is disengaged Port From (https://github.com/TrinityCore/TrinityCore/commit/ac6e242bffe433276d7aea66805a0755996ff904) --- Source/Game/Entities/Unit/Unit.Movement.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Game/Entities/Unit/Unit.Movement.cs b/Source/Game/Entities/Unit/Unit.Movement.cs index c2af784ad..be6d6d512 100644 --- a/Source/Game/Entities/Unit/Unit.Movement.cs +++ b/Source/Game/Entities/Unit/Unit.Movement.cs @@ -1067,7 +1067,7 @@ namespace Game.Entities //! Dying creatures will MoveFall from setDeathState if (hoverHeight != 0 && (!IsDying() || !IsUnit())) { - float newZ = GetPositionZ() - hoverHeight; + float newZ = Math.Max(GetFloorZ(), GetPositionZ() - hoverHeight); UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), ref newZ); UpdateHeight(newZ); }