]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
cleaned up cl_netinputpacketspersecond code a little for more readability (no change...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 9 Jul 2006 08:28:43 +0000 (08:28 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 9 Jul 2006 08:28:43 +0000 (08:28 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6506 d7cf8633-e32d-0410-b094-e92efae38249

cl_input.c

index 2824743c2e7291bfb133a86fd156431778d50458..d78b917f46f92fa67eb41ea4c22f239c7659ce89 100644 (file)
@@ -1219,11 +1219,13 @@ void CL_SendMove(void)
        }
        else
        {
-               if (realtime < lastsendtime + 1.0 / bound(10, cl_netinputpacketspersecond.value, 100))
+               double packettime = 1.0 / bound(10, cl_netinputpacketspersecond.value, 100);
+               // don't send too often or else network connections can get clogged by a high renderer framerate
+               if (realtime < lastsendtime + packettime)
                        return;
                // don't let it fall behind if CL_SendMove hasn't been called recently
                // (such is the case when framerate is too low for instance)
-               lastsendtime = max(lastsendtime + 1.0 / bound(10, cl_netinputpacketspersecond.value, 100), realtime);
+               lastsendtime = max(lastsendtime + packettime, realtime);
        }
 #if MOVEAVERAGING
        // average the accumulated changes