]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host_cmd.c
fixed r_drawcollisionbrushes 2
[xonotic/darkplaces.git] / host_cmd.c
index 2efcdd05626f41c1fd4f5a84b6673c6bcb3438d0..702d14961a21656291b04f46d6f6257882e9443e 100644 (file)
@@ -500,7 +500,7 @@ void Host_Savegame_f (void)
        FS_DefaultExtension (name, ".sav", sizeof (name));
 
        Con_Printf("Saving game to %s...\n", name);
-       f = FS_Open (name, "wb", false);
+       f = FS_Open (name, "wb", false, false);
        if (!f)
        {
                Con_Print("ERROR: couldn't open.\n");
@@ -519,7 +519,7 @@ void Host_Savegame_f (void)
        // write the light styles
        for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
        {
-               if (sv.lightstyles[i])
+               if (sv.lightstyles[i][0])
                        FS_Printf(f, "%s\n", sv.lightstyles[i]);
                else
                        FS_Print(f,"m\n");
@@ -533,8 +533,6 @@ void Host_Savegame_f (void)
 }
 
 
-extern mempool_t *edictstring_mempool;
-
 /*
 ===============
 Host_Loadgame_f
@@ -629,8 +627,7 @@ void Host_Loadgame_f (void)
        {
                // light style
                COM_ParseToken(&t, false);
-               sv.lightstyles[i] = Mem_Alloc(edictstring_mempool, strlen(com_token)+1);
-               strcpy (sv.lightstyles[i], com_token);
+               strlcpy(sv.lightstyles[i], com_token, sizeof(sv.lightstyles[i]));
        }
 
 // load the edicts out of the savegame file
@@ -739,7 +736,7 @@ void Host_Name_f (void)
 
        // point the string back at updateclient->name to keep it safe
        strlcpy (host_client->name, newName, sizeof (host_client->name));
-       host_client->edict->v->netname = PR_SetString(host_client->name);
+       host_client->edict->v->netname = PR_SetEngineString(host_client->name);
        if (strcmp(host_client->old_name, host_client->name))
        {
                if (host_client->spawned)
@@ -801,7 +798,7 @@ void Host_Playermodel_f (void)
        // point the string back at updateclient->name to keep it safe
        strlcpy (host_client->playermodel, newPath, sizeof (host_client->playermodel));
        if( eval_playermodel )
-               GETEDICTFIELDVALUE(host_client->edict, eval_playermodel)->string = PR_SetString(host_client->playermodel);
+               GETEDICTFIELDVALUE(host_client->edict, eval_playermodel)->string = PR_SetEngineString(host_client->playermodel);
        if (strcmp(host_client->old_model, host_client->playermodel))
        {
                if (host_client->spawned)
@@ -862,7 +859,7 @@ void Host_Playerskin_f (void)
        // point the string back at updateclient->name to keep it safe
        strlcpy (host_client->playerskin, newPath, sizeof (host_client->playerskin));
        if( eval_playerskin )
-               GETEDICTFIELDVALUE(host_client->edict, eval_playerskin)->string = PR_SetString(host_client->playerskin);
+               GETEDICTFIELDVALUE(host_client->edict, eval_playerskin)->string = PR_SetEngineString(host_client->playerskin);
        if (strcmp(host_client->old_skin, host_client->playerskin))
        {
                if (host_client->spawned)
@@ -1846,7 +1843,7 @@ static void MaxPlayers_f(void)
        if (svs.clients)
                Mem_Free(svs.clients);
        svs.maxclients = n;
-       svs.clients = Mem_Alloc(sv_clients_mempool, sizeof(client_t) * svs.maxclients);
+       svs.clients = Mem_Alloc(sv_mempool, sizeof(client_t) * svs.maxclients);
        if (n == 1)
                Cvar_Set ("deathmatch", "0");
        else