mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
behave sanely when the requested map doesn't exist (Closes #44). I'm
closing the bug because X closing on qf receiving TERM or KILL is due to X segfaulting and thus is an X bug.
This commit is contained in:
parent
d7e7b7de7d
commit
cddca4544d
1 changed files with 15 additions and 1 deletions
|
@ -246,21 +246,35 @@ Host_Map_f (void)
|
|||
{
|
||||
int i;
|
||||
char name[MAX_QPATH];
|
||||
const char *expanded;
|
||||
QFile *f;
|
||||
|
||||
if (cmd_source != src_command)
|
||||
return;
|
||||
|
||||
if (Cmd_Argc () > 2) {
|
||||
Con_Printf ("map <levelname> : continue game on a new level\n");
|
||||
return;
|
||||
}
|
||||
if (Cmd_Argc () == 1) {
|
||||
Con_Printf ("map is %s\n", sv.name);
|
||||
return;
|
||||
}
|
||||
|
||||
// check to make sure the level exists
|
||||
expanded = va ("maps/%s.bsp", Cmd_Argv (1));
|
||||
COM_FOpenFile (expanded, &f);
|
||||
if (!f) {
|
||||
Con_Printf ("Can't find %s\n", expanded);
|
||||
return;
|
||||
}
|
||||
Qclose (f);
|
||||
|
||||
cls.demonum = -1; // stop demo loop in case this fails
|
||||
|
||||
CL_Disconnect ();
|
||||
Host_ShutdownServer (false);
|
||||
|
||||
key_dest = key_game; // remove console or menu
|
||||
// SCR_BeginLoadingPlaque ();
|
||||
|
||||
cls.mapstring[0] = 0;
|
||||
|
|
Loading…
Reference in a new issue