diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Creature/Creature.h | 4 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 2 | ||||
-rw-r--r-- | src/server/game/Movement/PathGenerator.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index d6a28371954..7e1d4ac0b8d 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -112,8 +112,8 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma CreatureMovementData const& GetMovementTemplate() const; bool CanWalk() const { return GetMovementTemplate().IsGroundAllowed(); } bool CanSwim() const override { return GetMovementTemplate().IsSwimAllowed() || IsPet(); } - bool CanFly() const override { return GetMovementTemplate().IsFlightAllowed(); } - bool CanHover() const { return GetMovementTemplate().Ground == CreatureGroundMovementType::Hover; } + bool CanFly() const override { return GetMovementTemplate().IsFlightAllowed() || IsFlying(); } + bool CanHover() const { return GetMovementTemplate().Ground == CreatureGroundMovementType::Hover || IsHovering(); } MovementGeneratorType GetDefaultMovementType() const override { return m_defaultMovementType; } void SetDefaultMovementType(MovementGeneratorType mgt) { m_defaultMovementType = mgt; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7a88dd39fcb..ce14d9385da 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12410,7 +12410,7 @@ bool Unit::SetWalk(bool enable) bool Unit::SetDisableGravity(bool disable) { - if (disable == IsLevitating()) + if (disable == IsGravityDisabled()) return false; if (disable) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 63334d331f5..a3446114b44 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1202,7 +1202,7 @@ class TC_GAME_API Unit : public WorldObject void SetPlayHoverAnim(bool enable); void SetHoverHeight(float hoverHeight) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::HoverHeight), hoverHeight); } - bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); } + bool IsGravityDisabled() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); } bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); } bool IsHovering() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_HOVER); } bool SetWalk(bool enable); diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index a4b15baadb3..3d2e6de024e 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -179,7 +179,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con { TC_LOG_DEBUG("maps.mmaps", "++ BuildPolyPath :: (startPoly == 0 || endPoly == 0)"); BuildShortcut(); - bool path = _source->GetTypeId() == TYPEID_UNIT && _source->ToCreature()->IsFlying(); + bool path = _source->GetTypeId() == TYPEID_UNIT && _source->ToCreature()->CanFly(); bool waterPath = _source->GetTypeId() == TYPEID_UNIT && _source->ToCreature()->CanSwim(); if (waterPath) @@ -233,7 +233,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con TC_LOG_DEBUG("maps.mmaps", "++ BuildPolyPath :: flying case"); if (Unit const* _sourceUnit = _source->ToUnit()) { - if (_sourceUnit->IsFlying()) + if (_sourceUnit->CanFly()) buildShotrcut = true; // Allow to build a shortcut if the unit is falling and it's trying to move downwards towards a target (i.e. charging) else if (_sourceUnit->IsFalling() && endPos.z < startPos.z) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index c03f5d38bb2..8328e21890d 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2585,7 +2585,7 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode if (target->SetCanFly(apply)) { - if (!apply && !target->IsLevitating()) + if (!apply && !target->IsGravityDisabled()) target->GetMotionMaster()->MoveFall(); } } @@ -3012,7 +3012,7 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, target->SetCanTransitionBetweenSwimAndFly(apply); if (target->SetCanFly(apply)) - if (!apply && !target->IsLevitating()) + if (!apply && !target->IsGravityDisabled()) target->GetMotionMaster()->MoveFall(); } |