Con_Printf("%smove #%i %ims (%ims) %i %i '%i %i %i' '%i %i %i'\n", (move->time - host_client->cmd.time) > sv.frametime * 1.01 ? "^1" : "^2", move->sequence, (int)floor((move->time - host_client->cmd.time) * 1000.0 + 0.5), (int)floor(move->time * 1000.0 + 0.5), move->impulse, move->buttons, (int)move->viewangles[0], (int)move->viewangles[1], (int)move->viewangles[2], (int)move->forwardmove, (int)move->sidemove, (int)move->upmove);
#endif
// this is a new move
+ move->time = bound(sv.time - 1, move->time, sv.time); // prevent slowhack/speedhack combos
move->time = max(move->time, host_client->cmd.time); // prevent backstepping of time
moveframetime = bound(0, move->time - host_client->cmd.time, 0.1);
//Con_Printf("movesequence = %i (%i lost), moveframetime = %f\n", move->sequence, move->sequence ? move->sequence - host_client->movesequence - 1 : 0, moveframetime);
}
}
// now copy the new move
- sv_readmoves[sv_numreadmoves-1].time = max(sv_readmoves[sv_numreadmoves-1].time, host_client->cmd.time); // prevent backstepping of time
host_client->cmd = sv_readmoves[sv_numreadmoves-1];
+ host_client->cmd.time = max(host_client->cmd.time, sv.time);
+ // physics will run up to sv.time, so allow no predicted moves
+ // before that otherwise, there is a speedhack by turning
+ // prediction on and off repeatedly on client side because the
+ // engine would run BOTH client and server physics for the same
+ // time
host_client->movesequence = 0;
// make sure that normal physics takes over immediately
host_client->clmovement_skipphysicsframes = 0;