From: divverent Date: Tue, 9 Oct 2007 21:35:38 +0000 (+0000) Subject: last patch by LH fixed speedhack 1.0: -20ms + 30ms = 10ms, but moves by 30ms X-Git-Tag: xonotic-v0.1.0preview~2860 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2756f5666efa5ecd3855e3887412fe7eac61a9e5;p=xonotic%2Fdarkplaces.git 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 --- 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;