From 2756f5666efa5ecd3855e3887412fe7eac61a9e5 Mon Sep 17 00:00:00 2001 From: divverent Date: Tue, 9 Oct 2007 21:35:38 +0000 Subject: [PATCH] last patch by LH fixed speedhack 1.0: -20ms + 30ms = 10ms, but moves by 30ms this patch fixed speedhack 2.0: (cl_movement 0) -10ms + (cl_movement 1) 20ms = 20ms client physics and now also fixes speedhack 2.0a: (cl_movement 0) -10ms + (cl_movement 1) 20ms = 10ms server physics and 10ms client physics git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7619 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_user.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sv_user.c b/sv_user.c index 5fc53adc..70d3bafc 100644 --- a/sv_user.c +++ b/sv_user.c @@ -371,6 +371,8 @@ void SV_ClientThink (void) { vec3_t v_angle; + //Con_Printf("clientthink for %ims\n", (int) (sv.frametime * 1000)); + SV_ApplyClientMove(); // make sure the velocity is sane (not a NaN) SV_CheckVelocity(host_client->edict); @@ -628,6 +630,12 @@ void SV_ExecuteClientMoves(void) } // now copy the new move 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