diff options
author | Shauren <shauren.trinity@gmail.com> | 2013-02-22 01:21:49 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2013-02-22 01:21:49 +0100 |
commit | 0ef974a9de4187f080e90a9e3aa0a8087113a59d (patch) | |
tree | 8da44b281d07e706aef381e293ba600296ae6210 | |
parent | 5143804014a6485e2cd35f75fa9db64228518ef5 (diff) |
Core/Creatures: Set hover movement flag if bytes1 have hover flag and creature cannot fly
-rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index d2bc7c624b5..39534c1c2bf 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2112,9 +2112,11 @@ bool Creature::LoadCreaturesAddon(bool reload) SetByteValue(UNIT_FIELD_BYTES_1, 3, uint8((cainfo->bytes1 >> 24) & 0xFF)); //! Suspected correlation between UNIT_FIELD_BYTES_1, offset 3, value 0x2: - //! If no inhabittype_fly (if no MovementFlag_DisableGravity flag found in sniffs) + //! If no inhabittype_fly (if no MovementFlag_DisableGravity or MovementFlag_CanFly flag found in sniffs) + //! Check using InhabitType as movement flags are assigned dynamically + //! basing on whether the creature is in air or not //! Set MovementFlag_Hover. Otherwise do nothing. - if (GetByteValue(UNIT_FIELD_BYTES_1, 3) & UNIT_BYTE1_FLAG_HOVER && !IsLevitating()) + if (GetByteValue(UNIT_FIELD_BYTES_1, 3) & UNIT_BYTE1_FLAG_HOVER && !(GetCreatureTemplate()->InhabitType & INHABIT_AIR)) AddUnitMovementFlag(MOVEMENTFLAG_HOVER); } |