]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host_cmd.c
removed \n from all Host_Error, Sys_Error, PRVM_ERROR, PF_ERROR calls, since Host_Err...
[xonotic/darkplaces.git] / host_cmd.c
index 3a62b1dfb75b2b62d6cc3f959c839a7ea0b9da24..b3fd8db6be8ca8a2eec22bb8b106e8701b603b3a 100644 (file)
@@ -294,7 +294,12 @@ void Host_Changelevel_f (void)
                Con_Print("changelevel <levelname> : continue game on a new level\n");
                return;
        }
-       if (!sv.active || cls.demoplayback)
+       // HACKHACKHACK
+       if (!sv.active) {
+               Host_Map_f();
+               return;
+       }
+       if (cls.demoplayback)
        {
                Con_Print("Only the server may changelevel\n");
                return;
@@ -581,7 +586,7 @@ void Host_Loadgame_f (void)
 
        cls.demonum = -1;               // stop demo loop in case this fails
 
-       t = text = FS_LoadFile (filename, tempmempool, false);
+       t = text = (char *)FS_LoadFile (filename, tempmempool, false, NULL);
        if (!text)
        {
                Con_Print("ERROR: couldn't open.\n");
@@ -675,7 +680,7 @@ void Host_Loadgame_f (void)
                        if (entnum >= MAX_EDICTS)
                        {
                                Mem_Free(text);
-                               Host_Error("Host_PerformLoadGame: too many edicts in save file (reached MAX_EDICTS %i)\n", MAX_EDICTS);
+                               Host_Error("Host_PerformLoadGame: too many edicts in save file (reached MAX_EDICTS %i)", MAX_EDICTS);
                        }
                        while (entnum >= prog->max_edicts)
                                //SV_IncreaseEdicts();
@@ -899,7 +904,7 @@ void Host_Say(qboolean teamonly)
        const char *p1;
        char *p2;
        // LordHavoc: 256 char say messages
-       unsigned char text[256];
+       char text[256];
        qboolean fromServer = false;
 
        if (cmd_source == src_command)
@@ -971,7 +976,7 @@ void Host_Say_Team_f(void)
 void Host_Tell_f(void)
 {
        client_t *save;
-       size_t j;
+       int j;
        const char *p1, *p2;
        char text[1024]; // LordHavoc: FIXME: temporary buffer overflow fix (was 64)
        qboolean fromServer = false;
@@ -1018,7 +1023,7 @@ void Host_Tell_f(void)
        }
        while (p2 > p1 && (p2[-1] == '\n' || p2[-1] == '\r'))
                p2--;
-       for (j = strlen(text);j < (sizeof(text) - 2) && p1 < p2;)
+       for (j = (int)strlen(text);j < (int)(sizeof(text) - 2) && p1 < p2;)
                text[j++] = *p1++;
        text[j++] = '\n';
        text[j++] = 0;
@@ -1186,6 +1191,7 @@ void Host_Pause_f (void)
 ======================
 Host_PModel_f
 LordHavoc: only supported for Nehahra, I personally think this is dumb, but Mindcrime won't listen.
+LordHavoc: correction, Mindcrime will be removing pmodel in the future, but it's still stuck here for compatibility.
 ======================
 */
 cvar_t cl_pmodel = {CVAR_SAVE, "_cl_pmodel", "0"};
@@ -1341,9 +1347,12 @@ void Host_Spawn_f (void)
        // send all current light styles
        for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
        {
-               MSG_WriteByte (&host_client->message, svc_lightstyle);
-               MSG_WriteByte (&host_client->message, (char)i);
-               MSG_WriteString (&host_client->message, sv.lightstyles[i]);
+               if (sv.lightstyles[i][0])
+               {
+                       MSG_WriteByte (&host_client->message, svc_lightstyle);
+                       MSG_WriteByte (&host_client->message, (char)i);
+                       MSG_WriteString (&host_client->message, sv.lightstyles[i]);
+               }
        }
 
        // send some stats
@@ -1882,7 +1891,7 @@ static void MaxPlayers_f(void)
        if (svs.clients)
                Mem_Free(svs.clients);
        svs.maxclients = n;
-       svs.clients = Mem_Alloc(sv_mempool, sizeof(client_t) * svs.maxclients);
+       svs.clients = (client_t *)Mem_Alloc(sv_mempool, sizeof(client_t) * svs.maxclients);
        if (n == 1)
                Cvar_Set ("deathmatch", "0");
        else