From 4354475fb01e2621a788582e73225160fda626e5 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 4 Jan 2023 16:28:30 -0500 Subject: [PATCH] Core/Creatures: Never enable gravity for creatures that can only fly Port From (https://github.com/TrinityCore/TrinityCore/commit/263ce0cd308d508235d0201937b3b29911600722) --- Source/Game/Entities/Creature/Creature.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 5313df09d..43ae8b55c 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -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);