From d42812d5b56c9929feb9e7c600cd9220e4f5a76a Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 17 Sep 2022 14:08:11 +0100 Subject: [PATCH] Don't select a map - whether random (voting screen, randommap command, etc) or specific (map command) if it has no associated lump. --- src/g_game.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 7bff448a5..b27e5e6cc 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3401,7 +3401,7 @@ tryagain: { boolean isokmap = true; - if (!mapheaderinfo[ix]) + if (!mapheaderinfo[ix] || mapheaderinfo[ix]->lumpnum == LUMPERROR) continue; if ((mapheaderinfo[ix]->typeoflevel & tolflags) != tolflags @@ -4803,8 +4803,10 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep, freqc = 0; 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) )) continue; @@ -4924,6 +4926,8 @@ INT32 G_FindMapByNameOrCode(const char *mapname, char **realmapnamep) { if (newmapnum < 1 || newmapnum > nummapheaders) return 0; + if (!mapheaderinfo[newmapnum-1] || mapheaderinfo[newmapnum-1]->lumpnum == LUMPERROR) + return 0; } else {