]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
final speedhack fixes
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 10 Oct 2007 16:31:37 +0000 (16:31 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 10 Oct 2007 16:31:37 +0000 (16:31 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7625 d7cf8633-e32d-0410-b094-e92efae38249

sv_phys.c
sv_user.c

index 978768fe907c13f954da50f14300cf2cfe70009a..362689f8795fa954e69421a4e8c524e75bf331e5 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -2115,6 +2115,7 @@ void SV_Physics_ClientEntity(prvm_edict_t *ent)
                                SV_AddGravity (ent);
                        SV_CheckStuck (ent);
                        SV_WalkMove (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:
                }
                break;
        case MOVETYPE_TOSS:
index 70d3bafc10d70fca1476b2f8eed640f75aea6ba8..a2fb80d88ec9ed56ff56b617f64b510da20ef3dc 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -629,13 +629,8 @@ void SV_ExecuteClientMoves(void)
                        }
                }
                // now copy the new move
                        }
                }
                // 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 = 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;
                host_client->movesequence = 0;
                // make sure that normal physics takes over immediately
                host_client->clmovement_skipphysicsframes = 0;