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:
@@ -2513,7 +2513,7 @@ namespace Game.Entities
|
|||||||
bool canHover = CanHover();
|
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
|
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)
|
if (GetMovementTemplate().Flight == CreatureFlightMovementType.CanFly)
|
||||||
SetCanFly(true);
|
SetCanFly(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user