]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_save.c
gl_rmain: Comments and style fix (no pun intended...)
[xonotic/darkplaces.git] / sv_save.c
index f85d97f2103c559d4f261640068f26de926f952e..a08e33a58b37cd965bf5ce62867ddd4f205d90bf 100644 (file)
--- a/sv_save.c
+++ b/sv_save.c
@@ -185,7 +185,6 @@ void SV_Savegame_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
        char    name[MAX_QPATH];
-       qbool deadflag = false;
 
        if (!sv.active)
        {
@@ -193,25 +192,11 @@ void SV_Savegame_f(cmd_state_t *cmd)
                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_Print(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)
        {
@@ -572,6 +557,6 @@ void SV_Loadgame_f(cmd_state_t *cmd)
                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();
 }