// remove stale queue items
n = cl.movement_numqueue;
cl.movement_numqueue = 0;
- if (cl.servermovesequence)
+ if (cls.servermovesequence)
{
for (i = 0;i < n;i++)
{
- if (cl.movement_queue[i].sequence > cl.servermovesequence)
+ if (cl.movement_queue[i].sequence > cls.servermovesequence)
cl.movement_queue[cl.movement_numqueue++] = cl.movement_queue[i];
else if (i == 0)
cl.movement_replay_canjump = !cl.movement_queue[i].jump; // FIXME: this logic is quite broken
if (cl.movement_numqueue < (int)(sizeof(cl.movement_queue)/sizeof(cl.movement_queue[0])))
{
// add to input queue
- cl.movement_queue[cl.movement_numqueue].sequence = cl.movesequence;
+ cl.movement_queue[cl.movement_numqueue].sequence = cls.movesequence;
cl.movement_queue[cl.movement_numqueue].time = cl.movecmd[0].time;
cl.movement_queue[cl.movement_numqueue].frametime = bound(0, cl.movecmd[0].time - cl.movecmd[1].time, 0.1);
VectorCopy(cl.viewangles, cl.movement_queue[cl.movement_numqueue].viewangles);
s.movevars_airaccel_sideways_friction = cl_movement_airaccel_sideways_friction.value;
}
- cl.movement_predicted = (cl_movement.integer && !cls.demoplayback && cls.signon == SIGNONS && cl.stats[STAT_HEALTH] > 0 && !cl.intermission) && ((cls.protocol != PROTOCOL_DARKPLACES6 && cls.protocol != PROTOCOL_DARKPLACES7) || cl.servermovesequence);
+ cl.movement_predicted = (cl_movement.integer && !cls.demoplayback && cls.signon == SIGNONS && cl.stats[STAT_HEALTH] > 0 && !cl.intermission) && ((cls.protocol != PROTOCOL_DARKPLACES6 && cls.protocol != PROTOCOL_DARKPLACES7) || cls.servermovesequence);
if (cl.movement_predicted)
{
//Con_Printf("%f: ", cl.movecmd[0].time);
cl.cmd.msec = 100;
oldmsectime = msectime;
- cl.movesequence++;
+ cls.movesequence++;
if (cl_movement.integer)
- cl.cmd.sequence = cl.movesequence;
+ cl.cmd.sequence = cls.movesequence;
else
cl.cmd.sequence = 0;
CL_UpdatePrydonCursor();
// always dump the first two messages, because they may contain leftover inputs from the last level
- if (cl.movesequence > 2)
+ if (cls.movesequence > 2)
{
// update the cl.movecmd array which holds the most recent moves
for (i = CL_MAX_USERCMDS - 1;i >= 1;i--)
for (j = 0, cmd = &cl.movecmd[maxusercmds-1];j < maxusercmds;j++, cmd--)
{
// don't repeat any stale moves
- if (cmd->sequence && cmd->sequence < cl.servermovesequence)
+ if (cmd->sequence && cmd->sequence < cls.servermovesequence)
continue;
// 5/9 bytes
MSG_WriteByte (&buf, clc_move);
// (note: qw_download variables are also used)
cl_downloadack_t dp_downloadack[CL_MAX_DOWNLOADACKS];
+ // input sequence numbers are not reset on level change, only connect
+ int movesequence;
+ int servermovesequence;
+
// quakeworld stuff below
// value of "qport" cvar at time of connection
// queue of proposed moves
int movement_numqueue;
client_movementqueue_t movement_queue[256];
- int movesequence;
- int servermovesequence;
// whether the replay should allow a jump at the first sequence
qboolean movement_replay_canjump;
prog->globals.client->time = cl.time;
prog->globals.client->frametime = cl.time - csqc_frametime;
csqc_frametime = cl.time;
- prog->globals.client->servercommandframe = cl.servermovesequence;
- prog->globals.client->clientcommandframe = cl.movesequence;
+ prog->globals.client->servercommandframe = cls.servermovesequence;
+ prog->globals.client->clientcommandframe = cls.movesequence;
VectorCopy(cl.viewangles, prog->globals.client->input_angles);
VectorCopy(cl.viewangles, csqc_angles);
prog->globals.client->input_buttons = cl.cmd.buttons;
cls.state = ca_connected;
cls.signon = 0; // need all the signon messages before playing
cls.protocol = initialprotocol;
+ // reset move sequence numbering on this new connection
+ cls.movesequence = 0;
+ cls.servermovesequence = 0;
if (cls.protocol == PROTOCOL_QUAKEWORLD)
Cmd_ForwardStringToServer("new");
if (cls.protocol == PROTOCOL_QUAKE)
if (developer_networkentities.integer)
Con_Printf("recv: svc_entities %i\n", cl.latestframenums[LATESTFRAMENUMS-1]);
if (cls.protocol != PROTOCOL_QUAKE && cls.protocol != PROTOCOL_QUAKEDP && cls.protocol != PROTOCOL_NEHAHRAMOVIE && cls.protocol != PROTOCOL_DARKPLACES1 && cls.protocol != PROTOCOL_DARKPLACES2 && cls.protocol != PROTOCOL_DARKPLACES3 && cls.protocol != PROTOCOL_DARKPLACES4 && cls.protocol != PROTOCOL_DARKPLACES5 && cls.protocol != PROTOCOL_DARKPLACES6)
- cl.servermovesequence = MSG_ReadLong();
+ cls.servermovesequence = MSG_ReadLong();
// read entity numbers until we find a 0x8000
// (which would be remove world entity, but is actually a terminator)
while ((n = (unsigned short)MSG_ReadShort()) != 0x8000 && !msg_badread)