Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/Movement/Spline/MoveSplineInit.cpp
This commit is contained in:
Shauren
2013-06-01 18:34:58 +02:00
14 changed files with 102 additions and 31 deletions
@@ -29,11 +29,7 @@ namespace Movement
{
UnitMoveType SelectSpeedType(uint32 moveFlags)
{
/*! Not sure about MOVEMENTFLAG_CAN_FLY here - do creatures that can fly
but are on ground right now also have it? If yes, this needs a more
dynamic check, such as is flying now
*/
if (moveFlags & (MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY))
if (moveFlags & MOVEMENTFLAG_FLYING)
{
if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.flight >= speed_obj.flight_back*/)
return MOVE_FLIGHT_BACK;
@@ -55,6 +51,8 @@ namespace Movement
else if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.run >= speed_obj.run_back*/)
return MOVE_RUN_BACK;
// Flying creatures use MOVEMENTFLAG_CAN_FLY or MOVEMENTFLAG_DISABLE_GRAVITY
// Run speed is their default flight speed.
return MOVE_RUN;
}
@@ -88,22 +86,25 @@ namespace Movement
move_spline.onTransport = (unit->GetTransGUID() != 0);
uint32 moveFlags = unit->m_movementInfo.GetMovementFlags();
if (args.flags.walkmode)
moveFlags |= MOVEMENTFLAG_WALKING;
else
moveFlags &= ~MOVEMENTFLAG_WALKING;
moveFlags |= MOVEMENTFLAG_FORWARD;
if (!args.HasVelocity)
args.velocity = unit->GetSpeed(SelectSpeedType(moveFlags));
if (!args.Validate(unit))
return 0;
if (moveFlags & MOVEMENTFLAG_ROOT)
moveFlags &= ~MOVEMENTFLAG_MASK_MOVING;
if (!args.HasVelocity)
{
// If spline is initialized with SetWalk method it only means we need to select
// walk move speed for it but not add walk flag to unit
uint32 moveFlagsForSpeed = moveFlags;
if (args.flags.walkmode)
moveFlagsForSpeed |= MOVEMENTFLAG_WALKING;
args.velocity = unit->GetSpeed(SelectSpeedType(moveFlagsForSpeed));
}
if (!args.Validate(unit))
return 0;
unit->m_movementInfo.SetMovementFlags(moveFlags);
move_spline.Initialize(args);