aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Creature/Creature.h4
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp2
-rw-r--r--src/server/game/Entities/Unit/Unit.h2
-rw-r--r--src/server/game/Movement/PathGenerator.cpp4
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp4
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 a33a09b227c..3332189a1e2 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -98,8 +98,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 6f7f13ef7c8..37783c46ac6 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -13090,7 +13090,7 @@ bool Unit::SetWalk(bool enable)
bool Unit::SetDisableGravity(bool disable, bool /*packetOnly = false*/)
{
- 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 a90145c139f..ab4d013aafa 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1118,7 +1118,7 @@ class TC_GAME_API Unit : public WorldObject
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = nullptr);
void SendMovementFlagUpdate(bool self = false);
- 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); }
virtual bool SetWalk(bool enable);
diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp
index 39ee09731a3..af6b8b0b30c 100644
--- a/src/server/game/Movement/PathGenerator.cpp
+++ b/src/server/game/Movement/PathGenerator.cpp
@@ -178,7 +178,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)
@@ -232,7 +232,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 d331de21634..857b9def33c 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -2635,7 +2635,7 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode
if (target->SetCanFly(apply))
{
- if (!apply && !target->IsLevitating())
+ if (!apply && !target->IsGravityDisabled())
target->GetMotionMaster()->MoveFall();
}
}
@@ -3023,7 +3023,7 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp,
if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !target->HasAuraType(SPELL_AURA_FLY))))
{
if (target->SetCanFly(apply))
- if (!apply && !target->IsLevitating())
+ if (!apply && !target->IsGravityDisabled())
target->GetMotionMaster()->MoveFall();
}