From a94a03b60bdb6fe830843a069a511e2962718b5c Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 27 Feb 2015 20:21:24 +0000 Subject: [PATCH] Better handle invalid clc_ackframe commands. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12162 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_user.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sv_user.c b/sv_user.c index 3ac17f23..0cce2eb9 100644 --- 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; } -- 2.39.2