From ad42d0717e6cd0268e6e4cd25e2373353dee6c35 Mon Sep 17 00:00:00 2001 From: divverent Date: Tue, 22 Jan 2008 09:49:30 +0000 Subject: [PATCH] fix the "ping times for antilag/display wrong" issue, but increasing the problems of sv_clmovement_waitforinput a bit git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7987 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_phys.c | 1 - sv_user.c | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sv_phys.c b/sv_phys.c index 8777ea00..6262fb53 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -2183,7 +2183,6 @@ void SV_Physics_ClientEntity(prvm_edict_t *ent) SV_AddGravity (ent); SV_CheckStuck (ent); SV_WalkMove (ent); - host_client->cmd.time = max(host_client->cmd.time, sv.time); // ignore client movement data for anything before NOW } break; case MOVETYPE_TOSS: diff --git a/sv_user.c b/sv_user.c index 457536db..279c0367 100644 --- a/sv_user.c +++ b/sv_user.c @@ -581,6 +581,7 @@ void SV_ExecuteClientMoves(void) 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); @@ -629,8 +630,13 @@ void SV_ExecuteClientMoves(void) } } // 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; -- 2.39.2