aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMeji <alvaro.megias@outlook.com>2022-12-17 23:48:04 +0100
committerGitHub <noreply@github.com>2022-12-17 23:48:04 +0100
commit263ce0cd308d508235d0201937b3b29911600722 (patch)
treed7f80a48339665227e707118df649826bf193330 /src
parentce7806adc8dff5616f5d4766f4b1853d98afa523 (diff)
Core/Creatures: Never enable gravity for creatures that can only fly (#28411)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 9a6b319f723..37bc520a8ee 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -2778,7 +2778,7 @@ void Creature::UpdateMovementFlags()
bool canHover = CanHover();
bool isInAir = (G3D::fuzzyGt(GetPositionZ(), ground + (canHover ? *m_unitData->HoverHeight : 0.0f) + GROUND_HEIGHT_TOLERANCE) || G3D::fuzzyLt(GetPositionZ(), ground - GROUND_HEIGHT_TOLERANCE)); // 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);