File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -363,24 +363,14 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket)
363363 mover->RemoveAurasWithInterruptFlags (AURA_INTERRUPT_FLAG_LANDING); // Parachutes
364364
365365 /* process position-change */
366- WorldPacket data (opcode, recvPacket.size ());
367- int64 movementTime = (int64) movementInfo.time + _timeSyncClockDelta;
368- if (_timeSyncClockDelta == 0 || movementTime < 0 || movementTime > 0xFFFFFFFF )
369- {
370- TC_LOG_WARN (" misc" , " The computed movement time using clockDelta is erronous. Using fallback instead" );
371- movementInfo.time = GameTime::GetGameTimeMS ();
372- }
373- else
374- {
375- movementInfo.time = (uint32)movementTime;
376- }
377-
378366 movementInfo.guid = mover->GetGUID ();
367+ movementInfo.time = AdjustClientMovementTime (movementInfo.time );
368+ mover->m_movementInfo = movementInfo;
369+
370+ WorldPacket data (opcode, recvPacket.size ());
379371 WriteMovementInfo (&data, &movementInfo);
380372 mover->SendMessageToSet (&data, _player);
381373
382- mover->m_movementInfo = movementInfo;
383-
384374 // Some vehicles allow the passenger to turn by himself
385375 if (Vehicle* vehicle = mover->GetVehicle ())
386376 {
Original file line number Diff line number Diff line change @@ -1749,6 +1749,18 @@ void WorldSession::SendTimeSync()
17491749 _timeSyncNextCounter++;
17501750}
17511751
1752+ uint32 WorldSession::AdjustClientMovementTime (uint32 time) const
1753+ {
1754+ int64 movementTime = int64 (time) + _timeSyncClockDelta;
1755+ if (_timeSyncClockDelta == 0 || movementTime < 0 || movementTime > 0xFFFFFFFF )
1756+ {
1757+ TC_LOG_WARN (" misc" , " The computed movement time using clockDelta is erronous. Using fallback instead" );
1758+ return GameTime::GetGameTimeMS ();
1759+ }
1760+ else
1761+ return uint32 (movementTime);
1762+ }
1763+
17521764bool WorldSession::IsRightUnitBeingMoved (ObjectGuid guid)
17531765{
17541766 GameClient* client = GetGameClient ();
Original file line number Diff line number Diff line change @@ -662,6 +662,7 @@ class TC_GAME_API WorldSession
662662 // Time Synchronisation
663663 void ResetTimeSync ();
664664 void SendTimeSync ();
665+ uint32 AdjustClientMovementTime (uint32 time) const ;
665666
666667 // Packets cooldown
667668 time_t GetCalendarEventCreationCooldown () const { return _calendarEventCreationCooldown; }
You can’t perform that action at this time.
0 commit comments