diff options
| author | Shauren <shauren.trinity@gmail.com> | 2018-03-09 00:38:07 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2018-03-09 00:38:20 +0100 |
| commit | 7452074829c2682fea01135ebeb6d3f58759db77 (patch) | |
| tree | 3ce1884c61006b10518cb79c5a9e1a28682ca1c4 /src | |
| parent | fe2a7baa083c24c482dcfd8386bc0ab1c7ca7a5e (diff) | |
Core/Creatures: Fixed flying creatures using MOVEMENTFLAG_CAN_FLY
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 4f124f96e15..75a54f2ce36 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2297,8 +2297,16 @@ float WorldObject::SelectBestZForDestination(float x, float y, float z, bool exc { float const ground = GetFloorZ(); bool const isInAir = (G3D::fuzzyGt(unit->GetPositionZ(), ground + GROUND_HEIGHT_TOLERANCE) || G3D::fuzzyLt(unit->GetPositionZ(), ground - GROUND_HEIGHT_TOLERANCE)); - if (unit->IsFlying() && isInAir) - return z; + if (isInAir) + { + // creatures never get MOVEMENTFLAG_FLYING, check it additionally for them + if (Creature const* creature = ToCreature()) + if (creature->CanFly()) + return z; + + if (unit->IsFlying()) + return z; + } } float myX, myY, myZ; |
