]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host_cmd.c
some const fixes and type fixes found by gcc -combine
[xonotic/darkplaces.git] / host_cmd.c
index 17e30e8510df8d4fa1c7672b5549ac7438dca7ed..fc3db1b90efc5199bdab0daf471aed4fb2942aa6 100644 (file)
@@ -525,7 +525,10 @@ void Host_Savegame_f (void)
 
        PRVM_ED_WriteGlobals (f);
        for (i=0 ; i<prog->num_edicts ; i++)
+       {
+               Con_Printf("edict %d...\n", i);
                PRVM_ED_Write (f, PRVM_EDICT_NUM(i));
+       }
 
        SV_VM_End();
 
@@ -767,6 +770,15 @@ void Host_Name_f (void)
                        host_client->name[j++] = host_client->name[i];
        host_client->name[j] = 0;
 
+       if(host_client->name[0] == 1 || host_client->name[0] == 2)
+       // may interfere with chat area, and will needlessly beep; so let's add a ^7
+       {
+               memmove(host_client->name + 2, host_client->name, sizeof(host_client->name) - 2);
+               host_client->name[sizeof(host_client->name) - 1] = 0;
+               host_client->name[0] = STRING_COLOR_TAG;
+               host_client->name[1] = '0' + STRING_COLOR_DEFAULT;
+       }
+
        COM_StringLengthNoColors(host_client->name, 0, &valid_colors);
        if(!valid_colors) // NOTE: this also proves the string is not empty, as "" is a valid colored string
        {
@@ -1812,7 +1824,7 @@ Host_Viewmodel_f
 void Host_Viewmodel_f (void)
 {
        prvm_edict_t    *e;
-       model_t *m;
+       dp_model_t      *m;
 
        if (!sv.active)
                return;
@@ -1843,7 +1855,7 @@ void Host_Viewframe_f (void)
 {
        prvm_edict_t    *e;
        int             f;
-       model_t *m;
+       dp_model_t      *m;
 
        if (!sv.active)
                return;
@@ -1863,7 +1875,7 @@ void Host_Viewframe_f (void)
 }
 
 
-void PrintFrameName (model_t *m, int frame)
+void PrintFrameName (dp_model_t *m, int frame)
 {
        if (m->animscenes)
                Con_Printf("frame %i: %s\n", frame, m->animscenes[frame].name);
@@ -1879,7 +1891,7 @@ Host_Viewnext_f
 void Host_Viewnext_f (void)
 {
        prvm_edict_t    *e;
-       model_t *m;
+       dp_model_t      *m;
 
        if (!sv.active)
                return;
@@ -1906,7 +1918,7 @@ Host_Viewprev_f
 void Host_Viewprev_f (void)
 {
        prvm_edict_t    *e;
-       model_t *m;
+       dp_model_t      *m;
 
        if (!sv.active)
                return;
@@ -1953,7 +1965,7 @@ void Host_Startdemos_f (void)
                Con_Printf("Max %i demos in demoloop\n", MAX_DEMOS);
                c = MAX_DEMOS;
        }
-       Con_Printf("%i demo(s) in loop\n", c);
+       Con_DPrintf("%i demo(s) in loop\n", c);
 
        for (i=1 ; i<c+1 ; i++)
                strlcpy (cls.demos[i-1], Cmd_Argv(i), sizeof (cls.demos[i-1]));
@@ -2349,6 +2361,8 @@ void Host_Packet_f (void) // credit: taken from QuakeWorld
        }
 
        mysocket = NetConn_ChooseClientSocketForAddress(&address);
+       if (!mysocket)
+               mysocket = NetConn_ChooseServerSocketForAddress(&address);
        if (mysocket)
                NetConn_Write(mysocket, send, out - send, &address);
 }
@@ -2520,3 +2534,6 @@ void Host_InitCommands (void)
        Cvar_RegisterVariable(&sv_adminnick);
 }
 
+void Host_NoOperation_f(void)
+{
+}