]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
added PRVM_64 define which upgrades the QC VM to double precision
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 39dbe22146c94f8203e28ce402f687e9e54ee0eb..9b717993a938187a989c26f5f98585c2a2c66df3 100644 (file)
--- a/host.c
+++ b/host.c
@@ -667,6 +667,7 @@ void Host_Main(void)
        double wait;
        int pass1, pass2, pass3, i;
        char vabuf[1024];
+       qboolean playing;
 
        Host_Init();
 
@@ -706,14 +707,15 @@ void Host_Main(void)
                        svs.perf_acc_realtime += deltacleantime;
 
                        // Look for clients who have spawned
+                       playing = false;
                        for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
                                if(host_client->spawned)
                                        if(host_client->netconnection)
-                                               break;
-                       if(i == svs.maxclients)
+                                               playing = true;
+                       if(sv.time < 10)
                        {
-                               // Nobody is looking? Then we won't do timing...
-                               // Instead, reset it to zero
+                               // don't accumulate time for the first 10 seconds of a match
+                               // so things can settle
                                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 = 0;
                        }
                        else if(svs.perf_acc_realtime > 5)
@@ -727,7 +729,8 @@ void Host_Main(void)
                                        svs.perf_offset_sdev = sqrt(svs.perf_acc_offset_squared / svs.perf_acc_offset_samples - svs.perf_offset_avg * svs.perf_offset_avg);
                                }
                                if(svs.perf_lost > 0 && developer_extra.integer)
-                                       Con_DPrintf("Server can't keep up: %s\n", Host_TimingReport(vabuf, sizeof(vabuf)));
+                                       if(playing) // only complain if anyone is looking
+                                               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 = 0;
                        }
                }
@@ -896,7 +899,7 @@ void Host_Main(void)
                        SV_SendClientMessages();
 
                        if (sv.paused == 1 && realtime > sv.pausedstart && sv.pausedstart > 0) {
-                               prog->globals.generic[OFS_PARM0] = realtime - sv.pausedstart;
+                               prog->globals.fp[OFS_PARM0] = realtime - sv.pausedstart;
                                PRVM_serverglobalfloat(time) = sv.time;
                                prog->ExecuteProgram(prog, PRVM_serverfunction(SV_PausedTic), "QC function SV_PausedTic is missing");
                        }
@@ -1297,7 +1300,7 @@ static void Host_Init (void)
        }
 
        // put up the loading image so the user doesn't stare at a black screen...
-       SCR_BeginLoadingPlaque();
+       SCR_BeginLoadingPlaque(true);
 
        if (cls.state != ca_dedicated)
        {
@@ -1342,7 +1345,7 @@ static void Host_Init (void)
 
        if (!sv.active && !cls.demoplayback && !cls.connect_trying)
        {
-               Cbuf_AddText("togglemenu\n");
+               Cbuf_AddText("togglemenu 1\n");
                Cbuf_Execute();
        }