From 0ef974a9de4187f080e90a9e3aa0a8087113a59d Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 22 Feb 2013 01:21:49 +0100 Subject: Core/Creatures: Set hover movement flag if bytes1 have hover flag and creature cannot fly --- src/server/game/Entities/Creature/Creature.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3