Don't select a map - whether random (voting screen, randommap command, etc) or specific (map command) if it has no associated lump.

This commit is contained in:
toaster 2022-09-17 14:08:11 +01:00
parent 1a284ec7c6
commit d42812d5b5

View file

@ -3401,7 +3401,7 @@ tryagain:
{ {
boolean isokmap = true; boolean isokmap = true;
if (!mapheaderinfo[ix]) if (!mapheaderinfo[ix] || mapheaderinfo[ix]->lumpnum == LUMPERROR)
continue; continue;
if ((mapheaderinfo[ix]->typeoflevel & tolflags) != tolflags if ((mapheaderinfo[ix]->typeoflevel & tolflags) != tolflags
@ -4803,8 +4803,10 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
freqc = 0; freqc = 0;
for (i = 0, mapnum = 1; i < nummapheaders; ++i, ++mapnum) for (i = 0, mapnum = 1; i < nummapheaders; ++i, ++mapnum)
if (mapheaderinfo[i])
{ {
if (!mapheaderinfo[i] || mapheaderinfo[i]->lumpnum == LUMPERROR)
continue;
if (!( realmapname = G_BuildMapTitle(mapnum) )) if (!( realmapname = G_BuildMapTitle(mapnum) ))
continue; continue;
@ -4924,6 +4926,8 @@ INT32 G_FindMapByNameOrCode(const char *mapname, char **realmapnamep)
{ {
if (newmapnum < 1 || newmapnum > nummapheaders) if (newmapnum < 1 || newmapnum > nummapheaders)
return 0; return 0;
if (!mapheaderinfo[newmapnum-1] || mapheaderinfo[newmapnum-1]->lumpnum == LUMPERROR)
return 0;
} }
else else
{ {