From 95166ee810a6c6ab564132c1ca40cb46b0407673 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Fri, 27 Dec 2019 08:40:10 +0100 Subject: [PATCH] fix a crash when gamemap is not initialized This may happen when leaving a menu during the title screen when the first demos hasn't been loaded yet. --- Source/hu_stuff.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/hu_stuff.c b/Source/hu_stuff.c index 18bec3a7..dbf353d4 100644 --- a/Source/hu_stuff.c +++ b/Source/hu_stuff.c @@ -514,8 +514,14 @@ void HU_Start(void) // initialize the automap's level title widget + // [FG] fix crash when gamemap is not initialized + if (gamestate == GS_LEVEL && gamemap > 0) + { s = gamemode != commercial ? HU_TITLE : gamemission == pack_tnt ? HU_TITLET : gamemission == pack_plut ? HU_TITLEP : HU_TITLE2; + } + else + s = ""; while (*s) HUlib_addCharToTextLine(&w_title, *s++);