Core/Movement: Backported spline stop fix from 4.3.4 branch - use Stop spline type for stopping movement instead of starting movement that ends in creature's current position
This commit is contained in:
1 parent
8332cee052
commit
1966a78b9f
8 files changed
+91
-35
No files matched your search
@@ -109,13 +109,14 @@ namespace Movement
|
||||
if (!args.Validate(unit))
|
||||
return 0;
|
||||
|
||||
unit->m_movementInfo.SetMovementFlags((MovementFlags)moveFlags);
|
||||
unit->m_movementInfo.SetMovementFlags(moveFlags);
|
||||
move_spline.Initialize(args);
|
||||
|
||||
WorldPacket data(!transport ? SMSG_MONSTER_MOVE : SMSG_MONSTER_MOVE_TRANSPORT, 64);
|
||||
WorldPacket data(SMSG_MONSTER_MOVE, 64);
|
||||
data.append(unit->GetPackGUID());
|
||||
if (transport)
|
||||
{
|
||||
data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT);
|
||||
data.appendPackGUID(unit->GetTransGUID());
|
||||
data << int8(unit->GetTransSeat());
|
||||
}
|
||||
@@ -126,6 +127,32 @@ namespace Movement
|
||||
return move_spline.Duration();
|
||||
}
|
||||
|
||||
void MoveSplineInit::Stop()
|
||||
{
|
||||
MoveSpline& move_spline = *unit->movespline;
|
||||
|
||||
// No need to stop if we are not moving
|
||||
if (move_spline.Finalized())
|
||||
return;
|
||||
|
||||
Location loc = move_spline.ComputePosition();
|
||||
args.flags = MoveSplineFlag::Done;
|
||||
unit->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_SPLINE_ENABLED);
|
||||
move_spline.Initialize(args);
|
||||
|
||||
WorldPacket data(SMSG_MONSTER_MOVE, 64);
|
||||
data.append(unit->GetPackGUID());
|
||||
if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit->GetTransGUID())
|
||||
{
|
||||
data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT);
|
||||
data.appendPackGUID(unit->GetTransGUID());
|
||||
data << int8(unit->GetTransSeat());
|
||||
}
|
||||
|
||||
PacketBuilder::WriteStopMovement(loc, args.splineId, data);
|
||||
unit->SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
MoveSplineInit::MoveSplineInit(Unit* m) : unit(m)
|
||||
{
|
||||
args.splineId = splineIdGen.NewId();
|
||||
|
||||
Reference in new issue
Block a user