diff options
| author | ModoX <moardox@gmail.com> | 2024-04-21 12:59:12 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2024-04-21 12:59:12 +0200 |
| commit | a28facb95633435f89f134eec55a4a545251be9b (patch) | |
| tree | 5e6273f37dfaf3631cd7421f1e79df20245181a6 /src/server/game/Server | |
| parent | 377b51f76828befaaf6a6e7c3a9405fc8798d93d (diff) | |
Core/Movement: Fixed data sent in cyclic spline related packets
Diffstat (limited to 'src/server/game/Server')
| -rw-r--r-- | src/server/game/Server/Packets/MovementPackets.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/server/game/Server/Packets/MovementPackets.cpp b/src/server/game/Server/Packets/MovementPackets.cpp index f5e47aa88d4..8545ac6e59d 100644 --- a/src/server/game/Server/Packets/MovementPackets.cpp +++ b/src/server/game/Server/Packets/MovementPackets.cpp @@ -522,7 +522,6 @@ void WorldPackets::Movement::MonsterMove::InitializeSplineData(::Movement::MoveS WorldPackets::Movement::MovementSpline& movementSpline = SplineData.Move; ::Movement::MoveSplineFlag splineFlags = moveSpline.splineflags; - splineFlags.enter_cycle = moveSpline.isCyclic(); movementSpline.Flags = uint32(splineFlags & uint32(~::Movement::MoveSplineFlag::Mask_No_Monster_Move)); movementSpline.Face = moveSpline.facing.type; movementSpline.FaceDirection = moveSpline.facing.angle; @@ -564,24 +563,14 @@ void WorldPackets::Movement::MonsterMove::InitializeSplineData(::Movement::MoveS if (splineFlags & ::Movement::MoveSplineFlag::UncompressedPath) { - if (!splineFlags.cyclic) - { - uint32 count = spline.getPointCount() - 3; - for (uint32 i = 0; i < count; ++i) - movementSpline.Points.emplace_back(array[i + 2].x, array[i + 2].y, array[i + 2].z); - } - else - { - uint32 count = spline.getPointCount() - 3; - movementSpline.Points.emplace_back(array[1].x, array[1].y, array[1].z); - for (uint32 i = 0; i < count; ++i) - movementSpline.Points.emplace_back(array[i + 1].x, array[i + 1].y, array[i + 1].z); - } + uint32 count = spline.getPointCount() - (splineFlags.cyclic ? 4 : 3); + for (uint32 i = 0; i < count; ++i) + movementSpline.Points.emplace_back(array[i + 2].x, array[i + 2].y, array[i + 2].z); } else { - uint32 lastIdx = spline.getPointCount() - 3; - G3D::Vector3 const* realPath = &spline.getPoint(1); + uint32 lastIdx = spline.getPointCount() - (splineFlags.cyclic ? 4 : 3); + G3D::Vector3 const* realPath = &array[1]; movementSpline.Points.emplace_back(realPath[lastIdx].x, realPath[lastIdx].y, realPath[lastIdx].z); |
