Core/Creatures: Never enable gravity for creatures that can only fly

Port From (https://github.com/TrinityCore/TrinityCore/commit/263ce0cd308d508235d0201937b3b29911600722)
This commit is contained in:
hondacrx
2023-01-04 16:28:30 -05:00
parent a6a063d526
commit 4354475fb0
+1 -1
View File
@@ -2513,7 +2513,7 @@ namespace Game.Entities
bool canHover = CanHover();
bool isInAir = (MathFunctions.fuzzyGt(GetPositionZ(), ground + (canHover ? m_unitData.HoverHeight : 0.0f) + MapConst.GroundHeightTolerance) || MathFunctions.fuzzyLt(GetPositionZ(), ground - MapConst.GroundHeightTolerance)); // Can be underground too, prevent the falling
if (GetMovementTemplate().IsFlightAllowed() && isInAir && !IsFalling())
if (GetMovementTemplate().IsFlightAllowed() && (isInAir || !GetMovementTemplate().IsGroundAllowed()) && !IsFalling())
{
if (GetMovementTemplate().Flight == CreatureFlightMovementType.CanFly)
SetCanFly(true);