Defensively recreate title drawlist

Avoids a crash when connecting to a server in the Intro
This commit is contained in:
Eidolon 2022-05-18 21:04:33 -05:00
parent 516a5e8350
commit 169f33a101

View file

@ -3406,6 +3406,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);