aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-06-18 21:04:31 +0200
committerShauren <shauren.trinity@gmail.com>2013-06-18 21:04:31 +0200
commitf517467817207a75cbe395ec96de2dceb0cac5da (patch)
tree80457050fd0d460565895aba21ba285cbf323f86 /src/server/game/Spells
parent3367dd5be93b8e63dce41fe6e303aa8ec41a43db (diff)
parent89ec90753914ae89b2dbbc7a343cd8a667410af3 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp49
1 files changed, 13 insertions, 36 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index faaedf42b74..58f49f72cfd 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -2650,23 +2650,17 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode
}
//! Not entirely sure if this should be sent for creatures as well, but I don't think so.
- target->SetCanFly(apply);
if (!apply)
{
- target->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING_FLY);
- target->GetMotionMaster()->MoveFall();
target->m_movementInfo.SetFallTime(0);
+ target->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING_FLY);
+ target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
}
- Player* player = target->ToPlayer();
- if (!player)
- player = target->m_movedPlayer;
-
- if (player)
- player->SendMovementCanFlyChange();
+ target->SetCanFly(apply);
- //! We still need to initiate a server-side MoveFall here,
- //! which requires MSG_MOVE_FALL_LAND on landing.
+ if (target->GetTypeId() == TYPEID_UNIT)
+ target->GetMotionMaster()->MoveFall();
}
void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -2683,12 +2677,7 @@ void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode,
return;
}
- if (apply)
- target->AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING);
- else
- target->RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING);
-
- target->SendMovementWaterWalking();
+ target->SetWaterWalking(apply);
}
void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -2705,12 +2694,7 @@ void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode
return;
}
- if (apply)
- target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW);
- else
- target->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW);
-
- target->SendMovementFeatherFall();
+ target->SetFeatherFall(apply);
// start fall from current height
if (!apply && target->GetTypeId() == TYPEID_PLAYER)
@@ -2732,7 +2716,6 @@ void AuraEffect::HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool
}
target->SetHover(apply); //! Sets movementflags
- target->SendMovementHover();
}
void AuraEffect::HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
@@ -3054,6 +3037,8 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp,
return;
Unit* target = aurApp->GetTarget();
+ if (mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK)
+ target->UpdateSpeed(MOVE_FLIGHT, true);
//! Update ability to fly
if (GetAuraType() == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)
@@ -3061,22 +3046,17 @@ 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->m_movementInfo.SetFallTime(0);
target->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING_FLY);
+ target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
}
- Player* player = target->ToPlayer();
- if (!player)
- player = target->m_movedPlayer;
-
- if (player)
- player->SendMovementCanFlyChange();
+ target->SetCanFly(apply);
- //! We still need to initiate a server-side MoveFall here,
- //! which requires MSG_MOVE_FALL_LAND on landing.
+ if (target->GetTypeId() == TYPEID_UNIT)
+ target->GetMotionMaster()->MoveFall();
}
//! Someone should clean up these hacks and remove it from this function. It doesn't even belong here.
@@ -3091,9 +3071,6 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp,
target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 16314);
}
}
-
- if (mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK)
- target->UpdateSpeed(MOVE_FLIGHT, true);
}
void AuraEffect::HandleAuraModIncreaseSwimSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const