int i, k, l, numbuffers, lightstyles = 64;
char comment[SAVEGAME_COMMENT_LENGTH+1];
char line[MAX_INPUTLINE];
- qboolean isserver;
+ qbool isserver;
char *s;
// first we have to figure out if this can be saved in 64 lightstyles
{
prvm_prog_t *prog = SVVM_prog;
char name[MAX_QPATH];
- qboolean deadflag = false;
if (!sv.active)
{
return;
}
- deadflag = cl.islocalgame && svs.clients[0].active && PRVM_serveredictfloat(svs.clients[0].edict, deadflag);
-
- if (cl.islocalgame)
+ if(host.hook.SV_CanSave)
{
- // singleplayer checks
- if (cl.intermission)
- {
- Con_Print("Can't save in intermission.\n");
- return;
- }
-
- if (deadflag)
- {
- Con_Print("Can't savegame with a dead player\n");
+ if(!host.hook.SV_CanSave())
return;
- }
}
- else
- Con_Warn("Warning: saving a multiplayer game may have strange results when restored (to properly resume, all players must join in the same player slots and then the game can be reloaded).\n");
if (Cmd_Argc(cmd) != 2)
{
if (COM_ParseToken_Simple(&t, false, false, true))
k |= atoi(com_token);
if (!BufStr_FindCreateReplace(prog, i, k, "string"))
- Con_Errorf("failed to create stringbuffer %i\n", i);
+ Con_Printf(CON_ERROR "failed to create stringbuffer %i\n", i);
}
else
Con_Printf("unsupported stringbuffer index %i \"%s\"\n", i, com_token);
Con_Printf("unexpected end of line when parsing sv.bufstr (expected strindex)\n");
}
else
- Con_Errorf("failed to create stringbuffer %i \"%s\"\n", i, com_token);
+ Con_Printf(CON_ERROR "failed to create stringbuffer %i \"%s\"\n", i, com_token);
}
}
// skip any trailing text or unrecognized commands
Con_Printf("SV_Loadgame_f: finished\n");
// make sure we're connected to loopback
- if (sv.active && cls.state == ca_disconnected)
- CL_EstablishConnection("local:1", -2);
+ if(sv.active && host.hook.ConnectLocal)
+ host.hook.ConnectLocal();
}