From c21406c51d7f0dedddc53345c4f3788e996c3bf4 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 7 Dec 2025 20:23:47 +0100 Subject: [PATCH] g_demo: check for maplump existance directly cant really rely on mapheaderinfo to tell us if some map exists or not --- src/g_demo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_demo.c b/src/g_demo.c index 7b80f6702..605526543 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -2786,7 +2786,7 @@ void G_DoPlayDemo(char *defdemoname) demobuf.p += 4; // Extrainfo location // ...*map* not loaded? - if (!gamemap || (gamemap > NUMMAPS) || !mapheaderinfo[gamemap-1]) + if (!gamemap || (gamemap > NUMMAPS) || (W_CheckNumForName(G_BuildMapName(gamemap)) == LUMPERROR)) { snprintf(msg, 1024, M_GetText("%s features a course that is not currently loaded.\n"), pdemoname); CONS_Alert(CONS_ERROR, "%s", msg); @@ -2828,7 +2828,7 @@ void G_DoPlayDemo(char *defdemoname) } // ...*map* not loaded? - if (!(mapheaderinfo[gamemap-1]->menuflags & LF2_EXISTSHACK)) + if (!gamemap || (gamemap > NUMMAPS) || !mapheaderinfo[gamemap-1] || !(mapheaderinfo[gamemap-1]->menuflags & LF2_EXISTSHACK)) { snprintf(msg, 1024, M_GetText("%s features a course that is not currently loaded.\n"), pdemoname); CONS_Alert(CONS_ERROR, "%s", msg);