Core/Movement: fix units falling through the ground when hover mode is disengaged

Port From (https://github.com/TrinityCore/TrinityCore/commit/ac6e242bffe433276d7aea66805a0755996ff904)
This commit is contained in:
hondacrx
2022-05-24 12:48:37 -04:00
parent b29c191d99
commit 85766a168c
+1 -1
View File
@@ -1067,7 +1067,7 @@ namespace Game.Entities
//! Dying creatures will MoveFall from setDeathState //! Dying creatures will MoveFall from setDeathState
if (hoverHeight != 0 && (!IsDying() || !IsUnit())) if (hoverHeight != 0 && (!IsDying() || !IsUnit()))
{ {
float newZ = GetPositionZ() - hoverHeight; float newZ = Math.Max(GetFloorZ(), GetPositionZ() - hoverHeight);
UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), ref newZ); UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), ref newZ);
UpdateHeight(newZ); UpdateHeight(newZ);
} }