mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 14:52:08 +00:00
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:
parent
3a88e0f876
commit
a12e476479
1 changed files with 8 additions and 1 deletions
|
@ -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
|
SV_Map_f
|
||||||
|
@ -331,6 +332,11 @@ void SV_Map_f (void)
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
Con_Printf ("Can't find %s\n", expanded);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
@ -338,6 +344,7 @@ void SV_Map_f (void)
|
||||||
SV_BroadcastCommand ("changing\n");
|
SV_BroadcastCommand ("changing\n");
|
||||||
SV_SendMessagesToAll ();
|
SV_SendMessagesToAll ();
|
||||||
|
|
||||||
|
strcpy (curlevel, level);
|
||||||
SV_SpawnServer (level);
|
SV_SpawnServer (level);
|
||||||
|
|
||||||
SV_BroadcastCommand ("reconnect\n");
|
SV_BroadcastCommand ("reconnect\n");
|
||||||
|
|
Loading…
Reference in a new issue