]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Better handle invalid clc_ackframe commands.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 27 Feb 2015 20:21:24 +0000 (20:21 +0000)
committerRudolf Polzer <divVerent@xonotic.org>
Fri, 27 Feb 2015 20:26:12 +0000 (21:26 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12162 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=a94a03b60bdb6fe830843a069a511e2962718b5c

sv_user.c

index 3ac17f23d9aa1787270b75c7a6c465c98c18d666..0cce2eb9d84129266dd4b48e5ffbafd4f787ee2f 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -764,13 +764,18 @@ void SV_ApplyClientMove (void)
        PRVM_serveredictfloat(host_client->edict, ping_movementloss) = movementloss / (float) NETGRAPH_PACKETS;
 }
 
-static void SV_FrameLost(int framenum)
+static qboolean SV_FrameLost(int framenum)
 {
        if (host_client->entitydatabase5)
        {
-               EntityFrame5_LostFrame(host_client->entitydatabase5, framenum);
-               EntityFrameCSQC_LostFrame(host_client, framenum);
+               if (framenum <= host_client->entitydatabase5->latestframenum)
+               {
+                       EntityFrame5_LostFrame(host_client->entitydatabase5, framenum);
+                       EntityFrameCSQC_LostFrame(host_client, framenum);
+                       return true;
+               }
        }
+       return false;
 }
 
 static void SV_FrameAck(int framenum)
@@ -954,7 +959,8 @@ clc_stringcmd_invalid:
                        {
                                int i;
                                for (i = host_client->latestframenum + 1;i < num;i++)
-                                       SV_FrameLost(i);
+                                       if (!SV_FrameLost(i))
+                                               break;
                                SV_FrameAck(num);
                                host_client->latestframenum = num;
                        }