diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index d0ab5e78c97..e069f5653c9 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -437,7 +437,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) float ground = GetPositionZ(); GetMap()->GetWaterOrGroundLevel(GetPositionX(), GetPositionY(), GetPositionZ(), &ground); - bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground); + bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground + 0.05f) || G3D::fuzzyLt(GetPositionZ(), ground - 0.05f); // Can be underground too, prevent the falling if (cInfo->InhabitType & INHABIT_AIR && cInfo->InhabitType & INHABIT_GROUND && isInAir) SetCanFly(true); @@ -482,7 +482,7 @@ void Creature::Update(uint32 diff) float ground = GetPositionZ(); GetMap()->GetWaterOrGroundLevel(GetPositionX(), GetPositionY(), GetPositionZ(), &ground); - bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground + 0.05f); + bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground + 0.05f) || G3D::fuzzyLt(GetPositionZ(), ground - 0.05f); // Can be underground too, prevent the falling CreatureTemplate const* cinfo = GetCreatureTemplate(); if (cinfo->InhabitType & INHABIT_AIR && cinfo->InhabitType & INHABIT_GROUND && isInAir) @@ -1574,7 +1574,7 @@ void Creature::setDeathState(DeathState s) float ground = GetPositionZ(); GetMap()->GetWaterOrGroundLevel(GetPositionX(), GetPositionY(), GetPositionZ(), &ground); - bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground); + bool isInAir = G3D::fuzzyGt(GetPositionZ(), ground + 0.05f) || G3D::fuzzyLt(GetPositionZ(), ground - 0.05f); // Can be underground too, prevent the falling if (cinfo->InhabitType & INHABIT_AIR && cinfo->InhabitType & INHABIT_GROUND && isInAir) SetCanFly(true); |
