If new map requested and not found, try to restart the current one. If

that also fails, DIE GRACEFULLY rather than continue to run with things
all screwed up from the intermission settings.  Fixes weird behavior under
any mod where a map can change.
This commit is contained in:
Joseph Carter 2000-05-18 01:36:42 +00:00
parent 3a88e0f876
commit a12e476479
1 changed files with 8 additions and 1 deletions

View File

@ -302,7 +302,8 @@ void SV_Give_f (void)
}
}
// Use this to keep track of current level --KB
static char curlevel[MAX_QPATH] = "";
/*
======================
SV_Map_f
@ -331,6 +332,11 @@ void SV_Map_f (void)
if (!f)
{
Con_Printf ("Can't find %s\n", expanded);
// If curlevel == level, something is SCREWED! --KB
if (stricmp (level, curlevel) == 0)
SV_Error ("map: cannot restart level\n");
else
Cbuf_AddText (va("map %s", curlevel));
return;
}
fclose (f);
@ -338,6 +344,7 @@ void SV_Map_f (void)
SV_BroadcastCommand ("changing\n");
SV_SendMessagesToAll ();
strcpy (curlevel, level);
SV_SpawnServer (level);
SV_BroadcastCommand ("reconnect\n");