Skip to content

Commit cab8975

Browse files
authored
Core/Movement: Use AdjustClientMovementTime to remove redundant movement time calculations (#31492)
1 parent 2221ad3 commit cab8975

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

src/server/game/Handlers/MovementHandler.cpp

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -530,16 +530,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData)
530530
}
531531

532532
/* the client data has been verified. let's do the actual change now */
533-
int64 movementTime = (int64)movementInfo.time + _timeSyncClockDelta;
534-
if (_timeSyncClockDelta == 0 || movementTime < 0 || movementTime > 0xFFFFFFFF)
535-
{
536-
TC_LOG_WARN("misc", "The computed movement time using clockDelta is erronous. Using fallback instead");
537-
movementInfo.time = GameTime::GetGameTimeMS();
538-
}
539-
else
540-
{
541-
movementInfo.time = (uint32)movementTime;
542-
}
533+
movementInfo.time = AdjustClientMovementTime(movementInfo.time);
543534

544535
mover->m_movementInfo = movementInfo;
545536
mover->UpdatePosition(movementInfo.pos);
@@ -630,17 +621,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket& recvData)
630621
MovementInfo movementInfo;
631622
movementInfo.guid = guid;
632623
ReadMovementInfo(recvData, &movementInfo);
633-
634-
int64 movementTime = (int64)movementInfo.time + _timeSyncClockDelta;
635-
if (_timeSyncClockDelta == 0 || movementTime < 0 || movementTime > 0xFFFFFFFF)
636-
{
637-
TC_LOG_WARN("misc", "The computed movement time using clockDelta is erronous. Using fallback instead");
638-
movementInfo.time = GameTime::GetGameTimeMS();
639-
}
640-
else
641-
{
642-
movementInfo.time = (uint32)movementTime;
643-
}
624+
movementInfo.time = AdjustClientMovementTime(movementInfo.time);
644625

645626
mover->m_movementInfo = movementInfo;
646627
mover->UpdatePosition(movementInfo.pos);

0 commit comments

Comments
 (0)