prevent map command crash from maps with invalid or non existing mapinfo
dba7a7dc3c
This commit is contained in:
parent
7a0906d919
commit
b44e97cc21
1 changed files with 9 additions and 0 deletions
|
|
@ -2863,6 +2863,15 @@ static void Command_Map_f(void)
|
|||
// G_TOLFlag handles both multiplayer gametype and ignores it for !multiplayer
|
||||
else
|
||||
{
|
||||
|
||||
if (!mapheaderinfo[newmapnum-1] || mapheaderinfo[newmapnum-1] == NULL)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Invalid mapheaderinfo for Course %s (%s)\n"), realmapname, G_BuildMapName(newmapnum));
|
||||
Z_Free(realmapname);
|
||||
Z_Free(mapname);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(
|
||||
mapheaderinfo[newmapnum-1] &&
|
||||
mapheaderinfo[newmapnum-1]->typeoflevel & G_TOLFlag(newgametype)
|
||||
|
|
|
|||
Loading…
Reference in a new issue