#include <time.h>
#include "libcurl.h"
-#include "cdaudio.h"
-#include "cl_video.h"
-#include "progsvm.h"
-#include "csprogs.h"
-#include "sv_demo.h"
-#include "snd_main.h"
#include "taskqueue.h"
#include "utf8lib.h"
Mem_CheckSentinelsGlobal();
// if the accumulators haven't become positive yet, wait a while
- if (cls.state == ca_dedicated)
- wait = sv_timer * -1000000.0; // dedicated
- else if (!sv.active || svs.threaded)
- wait = cl_timer * -1000000.0; // connected to server, main menu, or server is on different thread
+ if(!sv_timer || !cl_timer)
+ wait = min(cl_timer, sv_timer) * -1000000.0;
else
- wait = max(cl_timer, sv_timer) * -1000000.0; // listen server or singleplayer
+ wait = max(cl_timer, sv_timer) * -1000000.0;
if (!host.restless && wait >= 1)
return wait;
time = 1; // because we cast to int
time0 = Sys_DirtyTime();
- if (sv_checkforpacketsduringsleep.integer && !sys_usenoclockbutbenchmark.integer && !svs.threaded) {
+ if (sv_checkforpacketsduringsleep.integer && !sys_usenoclockbutbenchmark.integer && !svs.threaded)
+ {
NetConn_SleepMicroseconds((int)time);
if (cls.state != ca_dedicated)
NetConn_ClientFrame(); // helps server browser get good ping values