]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host_cmd.c
added -demo and -demolooponly options. -demo starts the wanted demo and then shuts...
[xonotic/darkplaces.git] / host_cmd.c
index 01fcc7d2a4b7d8ad7414a923aa04851d8fa27d5f..b88d27bcfd993d21693465b0e4a22ca5ce93ae2b 100644 (file)
@@ -209,8 +209,7 @@ Host_Ping_f
 */
 void Host_Ping_f (void)
 {
-       int             i, j;
-       float   total;
+       int             i;
        client_t        *client;
 
        if (cmd_source == src_command)
@@ -224,11 +223,7 @@ void Host_Ping_f (void)
        {
                if (!client->active)
                        continue;
-               total = 0;
-               for (j=0 ; j<NUM_PING_TIMES ; j++)
-                       total+=client->ping_times[j];
-               total /= NUM_PING_TIMES;
-               SV_ClientPrintf("%4i %s\n", (int)(total*1000), client->name);
+               SV_ClientPrintf("%4i %s\n", (int)floor(client->ping*1000+0.5), client->name);
        }
 }
 
@@ -951,7 +946,8 @@ void Host_Say(qboolean teamonly)
                        SV_ClientPrint(text);
        host_client = save;
 
-       Con_Print(&text[1]);
+       if (cls.state == ca_dedicated)
+               Con_Print(&text[1]);
 }
 
 
@@ -1416,6 +1412,7 @@ void Host_Kick_f (void)
        if (cmd_source != src_command || !sv.active)
                return;
 
+       SV_VM_Begin();
        save = host_client;
 
        if (Cmd_Argc() > 2 && strcmp(Cmd_Argv(1), "#") == 0)
@@ -1474,6 +1471,7 @@ void Host_Kick_f (void)
        }
 
        host_client = save;
+       SV_VM_End();
 }
 
 /*
@@ -1666,7 +1664,12 @@ void Host_Viewmodel_f (void)
        prvm_edict_t    *e;
        model_t *m;
 
+       if (!sv.active)
+               return;
+
+       SV_VM_Begin();
        e = FindViewthing ();
+       SV_VM_End();
        if (!e)
                return;
 
@@ -1692,7 +1695,12 @@ void Host_Viewframe_f (void)
        int             f;
        model_t *m;
 
+       if (!sv.active)
+               return;
+
+       SV_VM_Begin();
        e = FindViewthing ();
+       SV_VM_End();
        if (!e)
                return;
        m = cl.model_precache[(int)e->fields.server->modelindex];
@@ -1723,7 +1731,12 @@ void Host_Viewnext_f (void)
        prvm_edict_t    *e;
        model_t *m;
 
+       if (!sv.active)
+               return;
+
+       SV_VM_Begin();
        e = FindViewthing ();
+       SV_VM_End();
        if (!e)
                return;
        m = cl.model_precache[(int)e->fields.server->modelindex];
@@ -1745,7 +1758,12 @@ void Host_Viewprev_f (void)
        prvm_edict_t    *e;
        model_t *m;
 
+       if (!sv.active)
+               return;
+
+       SV_VM_Begin();
        e = FindViewthing ();
+       SV_VM_End();
        if (!e)
                return;
 
@@ -1776,7 +1794,7 @@ void Host_Startdemos_f (void)
 {
        int             i, c;
 
-       if (cls.state == ca_dedicated || COM_CheckParm("-listen"))
+       if (cls.state == ca_dedicated || COM_CheckParm("-listen") || COM_CheckParm("-benchmark") || COM_CheckParm("-demo") || COM_CheckParm("-demolooponly"))
                return;
 
        c = Cmd_Argc() - 1;