fix restart command (can't do the "connect local" for a restart)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 28 Sep 2002 10:23:16 +0000 (10:23 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 28 Sep 2002 10:23:16 +0000 (10:23 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2463 d7cf8633-e32d-0410-b094-e92efae38249

host_cmd.c

index 6a648c3..652f1ce 100644 (file)
@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 int current_skill;
 char sv_spawnmap[MAX_QPATH];
 char sv_loadgame[MAX_OSPATH];
+int sv_restartmap;
 
 dfunction_t *ED_FindFunction (char *name);
 
@@ -299,7 +300,7 @@ void Host_Restart_f (void)
 
        if (cmd_source != src_command)
                return;
-       strcpy (sv_spawnmap, sv.name);
+       sv_restartmap = true;
 }
 
 /*
@@ -1603,8 +1604,14 @@ void Host_PerformSpawnServerAndLoadGame(void)
                if (sv.active && cls.state != ca_dedicated)
                        Cmd_ExecuteString ("connect local", src_command);
        }
+       else if (sv_restartmap)
+       {
+               strcpy(sv_spawnmap, sv.name);
+               SV_SpawnServer(sv_spawnmap);
+       }
        sv_loadgame[0] = 0;
        sv_spawnmap[0] = 0;
+       sv_restartmap = 0;
 }
 
 //=============================================================================