]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix the "ping times for antilag/display wrong" issue, but increasing the problems...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 22 Jan 2008 09:49:30 +0000 (09:49 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 22 Jan 2008 09:49:30 +0000 (09:49 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7987 d7cf8633-e32d-0410-b094-e92efae38249

sv_phys.c
sv_user.c

index 8777ea00a34a7ece5d9e6a822877a5b9bad05f82..6262fb5373726cb377935a788eab7ecd04c15d64 100644 (file)
--- 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:
index 457536db0476ccfcab864ce7a78389aa06fb352b..279c036776399c9a82c9d1bbfc9d83114de896e6 100644 (file)
--- 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;