]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
sv_main: Receive packets even if we're gonna sleep, matching old behavior
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 23 Jul 2020 03:20:15 +0000 (03:20 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 23 Jul 2020 03:20:15 +0000 (03:20 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12868 d7cf8633-e32d-0410-b094-e92efae38249

sv_main.c

index 05028bd2927134c779193a77e052371d18175219..e34e7438a16b3471250be17f94c042f2d2ef2379 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -4143,6 +4143,11 @@ double SV_Frame(double time)
                                        Con_DPrintf("Server can't keep up: %s\n", Host_TimingReport(vabuf, sizeof(vabuf)));
                        svs.perf_acc_realtime = svs.perf_acc_sleeptime = svs.perf_acc_lost = svs.perf_acc_offset = svs.perf_acc_offset_squared = svs.perf_acc_offset_max = svs.perf_acc_offset_samples = host.sleeptime = 0;
                }
+
+               // receive packets on each main loop iteration, as the main loop may
+               // be undersleeping due to select() detecting a new packet
+               if (sv.active)
+                       NetConn_ServerFrame();
        }
 
        if((sv_timer += time) < 0)
@@ -4166,10 +4171,7 @@ double SV_Frame(double time)
                double advancetime, aborttime = 0;
                float offset;
                prvm_prog_t *prog = SVVM_prog;
-               // receive packets on each main loop iteration, as the main loop may
-               // be undersleeping due to select() detecting a new packet
-               if (sv.active && !svs.threaded)
-                       NetConn_ServerFrame();
+
                // run the world state
                // don't allow simulation to run too fast or too slow or logic glitches can occur