diff options
author | Ovah <dreadkiller@gmx.de> | 2020-10-01 04:41:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 04:41:08 +0200 |
commit | e811b9cdc2582cb1504e85b43d80696031fe2634 (patch) | |
tree | 80b2ab37a00e674f85228ffcfb8b40a588fe3494 | |
parent | 31abdc6ecfd84ef019880ffb531bf0298f921e77 (diff) |
Core/Movement: fix units falling through the ground when hover mode is disengaged (PR #25518)
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 2 |
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 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<float>(GetFloorZ(), GetPositionZ() - hoverHeight); UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), newZ); UpdateHeight(newZ); } |