aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOvah <dreadkiller@gmx.de>2020-10-01 04:41:08 +0200
committerShauren <shauren.trinity@gmail.com>2022-02-28 14:08:36 +0100
commitac6e242bffe433276d7aea66805a0755996ff904 (patch)
tree9070e03978de8884edbc0789911636c96d461078 /src
parenteeac4a12f244e7f730f772b4093cc5089dfc6a0c (diff)
Core/Movement: fix units falling through the ground when hover mode is disengaged (PR #25518)
(cherry picked from commit e811b9cdc2582cb1504e85b43d80696031fe2634)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index a1750be34a8..25f3c5ca404 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -12696,7 +12696,7 @@ bool Unit::SetHover(bool enable, bool updateAnimationTier /*= true*/)
//! Dying creatures will MoveFall from setDeathState
if (hoverHeight && (!isDying() || GetTypeId() != TYPEID_UNIT))
{
- float newZ = GetPositionZ() - hoverHeight;
+ float newZ = std::max<float>(GetFloorZ(), GetPositionZ() - hoverHeight);
UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), newZ);
UpdateHeight(newZ);
}