From: terencehill Date: Wed, 18 May 2022 10:21:44 +0000 (+0200) Subject: Fix #2689 "Welcome dialog is not closed by voting screens or by disconnecting" X-Git-Tag: xonotic-v0.8.5~31 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=985f8850e3b43520a439ebffe01b3f1bc4a72f10;p=xonotic%2Fxonotic-data.pk3dir.git Fix #2689 "Welcome dialog is not closed by voting screens or by disconnecting" --- diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 8bd5d7863..091cc4661 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -1438,6 +1438,8 @@ void Welcome_Message_Show_Try() string msg = MakeConsoleSafe(strreplace("\n", "\\n", welcome_msg)); welcomedialog_args = strcat(welcomedialog_args, " WELCOME \"", msg, "\""); localcmd("\nmenu_cmd directmenu Welcome ", welcomedialog_args, "\n"); + if (intermission) // close it after it's been initialized so it can still be opened manually + localcmd("\ntogglemenu 0\n"); } else centerprint_Add(ORDINAL(CPID_MOTD), strcat(hostname, "\n\n\n", welcome_msg), -1, 0); diff --git a/qcsrc/menu/xonotic/dialog_welcome.qc b/qcsrc/menu/xonotic/dialog_welcome.qc index ca80ef4dd..5da6f8b1e 100644 --- a/qcsrc/menu/xonotic/dialog_welcome.qc +++ b/qcsrc/menu/xonotic/dialog_welcome.qc @@ -71,6 +71,10 @@ void XonoticWelcomeDialog_readInputArgs(entity me, int argsbuf) void XonoticWelcomeDialog_draw(entity me) { SUPER(XonoticWelcomeDialog).draw(me); + + if (!(gamestatus & (GAME_ISSERVER | GAME_CONNECTED))) + me.close(me); + if(me.serverinfo_MOTD == "" && gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) { // if serverinfo_MOTD is empty while connected it means we are connected to an old server