Core/Movement: fix units falling through the ground when hover mode is disengaged (PR #25518)

This commit is contained in:
Ovah
2020-10-01 04:41:08 +02:00
committed by GitHub
parent 31abdc6ecf
commit e811b9cdc2

View File

@@ -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);
}