diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 10 | ||||
-rw-r--r-- | src/server/game/Movement/MotionMaster.cpp | 5 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 14 |
3 files changed, 10 insertions, 19 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e4bede0cb06..2ff096d2d27 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15257,14 +15257,9 @@ bool Unit::SetDisableGravity(bool disable) { AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_SPLINE_ELEVATION); - SetFall(false); } else - { RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); - if (!HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY)) - SetFall(true); - } static OpcodeServer const gravityOpcodeTable[2][2] = { @@ -15337,14 +15332,9 @@ bool Unit::SetCanFly(bool enable) { AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_SPLINE_ELEVATION); - SetFall(false); } else - { RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_MASK_MOVING_FLY); - if (!IsLevitating()) - SetFall(true); - } static OpcodeServer const flyOpcodeTable[2][2] = { diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index af9fb9b5f6e..94dcd71b5d5 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -473,8 +473,11 @@ void MotionMaster::MoveFall(uint32 id /*=0*/) if (std::fabs(_owner->GetPositionZ() - tz) < 0.1f) return; + _owner->SetFall(true); + + // don't run spline movement for players if (_owner->GetTypeId() == TYPEID_PLAYER) - _owner->SetFall(true); + return; Movement::MoveSplineInit init(_owner); init.MoveTo(_owner->GetPositionX(), _owner->GetPositionY(), tz, false); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 522b09d62f4..b6223088794 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2611,10 +2611,9 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode return; } - target->SetCanFly(apply); - - if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating()) - target->GetMotionMaster()->MoveFall(); + if (target->SetCanFly(apply)) + if (!apply && !target->IsLevitating()) + target->GetMotionMaster()->MoveFall(); } void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -3021,10 +3020,9 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !target->HasAuraType(SPELL_AURA_FLY)))) { - target->SetCanFly(apply); - - if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating()) - target->GetMotionMaster()->MoveFall(); + if (target->SetCanFly(apply)) + if (!apply && !target->IsLevitating()) + target->GetMotionMaster()->MoveFall(); } //! Someone should clean up these hacks and remove it from this function. It doesn't even belong here. |