]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
test c
authorbones_was_here <bones_was_here@xa.org.au>
Thu, 13 May 2021 20:12:59 +0000 (06:12 +1000)
committerbones_was_here <bones_was_here@xa.org.au>
Sat, 15 May 2021 11:47:00 +0000 (21:47 +1000)
sv_user.c

index 6af9d1a3a4ad0da5fa0c2a7bcc32c8be29f10cad..0a7c8fe1ac94374d6ac1eeca4d00db0e79bd074b 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -829,9 +829,18 @@ static void SV_ExecuteClientMoves(void)
                                        // count the move as LOST if we don't
                                        // execute it but it has higher
                                        // sequence count
-                                       if(host_client->movesequence)
-                                               if(move->sequence > host_client->movesequence)
-                                                       host_client->movement_count[(move->sequence) % NETGRAPH_PACKETS] = -1;
+                                       if(host_client->movesequence && move->sequence > host_client->movesequence)
+                                       {
+                                               host_client->movement_count[(move->sequence) % NETGRAPH_PACKETS] = -1;
+
+                                               // bones_was_here: if we are discarding the move due to inputtimeout,
+                                               // and it's the last received and has the highest sequence count,
+                                               // set cmd.time to allow for persistent latency increases,
+                                               // and to calculate the moveframetime the client expects next frame
+                                               if(host_client->clmovement_inputtimeout == -666 && moveindex == sv_numreadmoves - 1 && sv_clmovement_inputtimeout_strict.integer < 2)
+                                                       host_client->cmd.time = move->time - sv.frametime;
+                                       }
+
                                        continue;
                                }