bottom[1] = top[1];
bottom[2] = top[2] - 160;
- tr = SV_TraceLine(top, bottom, MOVE_NOMONSTERS, host_client->edict, SUPERCONTENTS_SOLID);
+ tr = SV_TraceLine(top, bottom, MOVE_NOMONSTERS, host_client->edict, SUPERCONTENTS_SOLID, collision_extendmovelength.value);
// if looking at a wall, leave ideal the way is was
if (tr.startsolid)
return;
start[2] = PRVM_serveredictvector(host_client->edict, origin)[2] + PRVM_serveredictvector(host_client->edict, mins)[2];
stop[2] = start[2] - 34;
- trace = SV_TraceLine(start, stop, MOVE_NOMONSTERS, host_client->edict, SV_GenericHitSuperContentsMask(host_client->edict));
+ trace = SV_TraceLine(start, stop, MOVE_NOMONSTERS, host_client->edict, SV_GenericHitSuperContentsMask(host_client->edict), collision_extendmovelength.value);
if (trace.fraction == 1.0)
friction = sv_friction.value*sv_edgefriction.value;
move->receivetime = (float)sv.time;
#if DEBUGMOVES
- Con_Printf("%s move%i #%i %ims (%ims) %i %i '%i %i %i' '%i %i %i'\n", move->time > move->receivetime ? "^3read future" : "^4read normal", sv_numreadmoves + 1, 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);
+ Con_Printf("%s move%i #%u %ims (%ims) %i %i '%i %i %i' '%i %i %i'\n", move->time > move->receivetime ? "^3read future" : "^4read normal", sv_numreadmoves + 1, 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
// limit reported time to current time
// (incase the client is trying to cheat)
if(host_client->movement_highestsequence_seen)
{
// mark moves in between as lost
- if(move->sequence - host_client->movement_highestsequence_seen - 1 < NETGRAPH_PACKETS)
- for(i = host_client->movement_highestsequence_seen + 1; i < move->sequence; ++i)
- host_client->movement_count[i % NETGRAPH_PACKETS] = -1;
+ unsigned int delta = move->sequence - host_client->movement_highestsequence_seen - 1;
+ if(delta < NETGRAPH_PACKETS)
+ {
+ unsigned int u;
+ for(u = 0; u < delta; ++u)
+ host_client->movement_count[(host_client->movement_highestsequence_seen + 1 + u) % NETGRAPH_PACKETS] = -1;
+ }
else
memset(host_client->movement_count, -1, sizeof(host_client->movement_count));
}
if (sv_numreadmoves < 1)
return;
// only start accepting input once the player is spawned
- if (!host_client->spawned)
+ if (!host_client->begun)
return;
#if DEBUGMOVES
Con_Printf("SV_ExecuteClientMoves: read %i moves at sv.time %f\n", sv_numreadmoves, (float)sv.time);
if (host_client->movesequence < move->sequence || moveindex == sv_numreadmoves - 1)
{
#if DEBUGMOVES
- 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);
+ Con_Printf("%smove #%u %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
PRVM_serveredictfloat(host_client->edict, ping_movementloss) = movementloss / (float) NETGRAPH_PACKETS;
}
-static void SV_FrameLost(int framenum)
+static qboolean SV_FrameLost(int framenum)
{
if (host_client->entitydatabase5)
{
- EntityFrame5_LostFrame(host_client->entitydatabase5, framenum);
- EntityFrameCSQC_LostFrame(host_client, framenum);
+ if (framenum <= host_client->entitydatabase5->latestframenum)
+ {
+ EntityFrame5_LostFrame(host_client->entitydatabase5, framenum);
+ EntityFrameCSQC_LostFrame(host_client, framenum);
+ return true;
+ }
}
+ return false;
}
static void SV_FrameAck(int framenum)
clc_stringcmd_invalid:
Con_Printf("Received invalid stringcmd from %s\n", host_client->name);
if(developer.integer > 0)
- Com_HexDumpToConsole((unsigned char *) s, strlen(s));
+ Com_HexDumpToConsole((unsigned char *) s, (int)strlen(s));
break;
case clc_disconnect:
// if the client hasn't progressed through signons yet,
// ignore any clc_ackframes we get (they're probably from the
// previous level)
- if (host_client->spawned && host_client->latestframenum < num)
+ if (host_client->begun && host_client->latestframenum < num)
{
int i;
for (i = host_client->latestframenum + 1;i < num;i++)
- SV_FrameLost(i);
+ if (!SV_FrameLost(i))
+ break;
SV_FrameAck(num);
host_client->latestframenum = num;
}