mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-08 17:22:18 +00:00
Defensively recreate title drawlist
Avoids a crash when connecting to a server in the Intro
This commit is contained in:
parent
516a5e8350
commit
169f33a101
1 changed files with 9 additions and 0 deletions
|
@ -3406,6 +3406,15 @@ void F_TitleScreenDrawer(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
luahook:
|
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)
|
if (renderisnewtic)
|
||||||
{
|
{
|
||||||
LUA_HUD_ClearDrawList(luahuddrawlist_title);
|
LUA_HUD_ClearDrawList(luahuddrawlist_title);
|
||||||
|
|
Loading…
Reference in a new issue