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");
// 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");
}
-extern mempool_t *edictstring_mempool;
-
/*
===============
Host_Loadgame_f
{
// 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
// 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)
// 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)
// 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)
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