fix(Core/Entities): Knock back players if they are not under client control. (#26540)

Co-authored-by: Claude <claude@users.noreply.github.com>
Co-authored-by: sogladev <sogladev@gmail.com>
This commit is contained in:
Benjamin Jackson
2026-07-10 11:36:22 -04:00
committed by GitHub
parent edb3730f7a
commit ac071f8f5d
3 changed files with 24 additions and 7 deletions
+9 -3
View File
@@ -840,14 +840,20 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket& recvData)
movementInfo.guid = guid;
ReadMovementInfo(recvData, &movementInfo);
mover->m_movementInfo = movementInfo;
// Relocate the mover to the acknowledged position. Otherwise the server (and the
// MSG_MOVE_KNOCK_BACK broadcast below) keeps using the pre-knockback position until
// the next regular movement packet arrives, desyncing the unit for nearby clients
if (!ProcessMovementInfo(movementInfo, mover, mover->ToPlayer(), recvData))
{
recvData.rfinish(); // prevent warnings spam
return;
}
if (mover->IsPlayer() && static_cast<Player*>(mover)->IsFreeFlying())
mover->SetCanFly(true);
WorldPacket data(MSG_MOVE_KNOCK_BACK, 66);
data << guid.WriteAsPacked();
_player->m_mover->BuildMovementPacket(&data);
WriteMovementInfo(&data, &movementInfo);
_player->SetCanTeleport(true);
// knockback specific info
data << movementInfo.jump.sinAngle;