From 64d0649c90160d98df316b13f1af2f06ccaa05eb Mon Sep 17 00:00:00 2001 From: Eidolon Date: Wed, 18 May 2022 21:04:33 -0500 Subject: [PATCH] Defensively recreate title drawlist Avoids a crash when connecting to a server in the Intro --- src/f_finale.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/f_finale.c b/src/f_finale.c index 04ae1c2c6..efa680083 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -2015,6 +2015,15 @@ void F_TitleScreenDrawer(void) } luahook: + // The title drawer is sometimes called without first being started + // In order to avoid use-before-initialization crashes, let's check and + // create the drawlist if it doesn't exist. + if (!LUA_HUD_IsDrawListValid(luahuddrawlist_title)) + { + LUA_HUD_DestroyDrawList(luahuddrawlist_title); + luahuddrawlist_title = LUA_HUD_CreateDrawList(); + } + if (renderisnewtic) { LUA_HUD_ClearDrawList(luahuddrawlist_title);