]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/menu.qc
Merge branch 'bones_was_here/vidsettings' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / menu.qc
index 4030270d321b727222074e2d7fbe7ec1709446ef..efed9ff2eac775a806e2f114e67d8e185069bedb 100644 (file)
@@ -672,14 +672,15 @@ void m_tooltip(vector pos)
        }
 }
 
+const int MIN_DISCONNECTION_TIME = 1;
 float autocvar_menu_force_on_disconnection;
 bool autocvar_g_campaign;
 void m_draw(float width, float height)
 {
-       if (autocvar_menu_force_on_disconnection > 0)
+       static float connected_time;
+       if (clientstate() == CS_DISCONNECTED)
        {
-               static float connected_time;
-               if (clientstate() == CS_DISCONNECTED)
+               if (connected_time && time - connected_time > MIN_DISCONNECTION_TIME)
                {
                        if (autocvar_g_campaign)
                        {
@@ -689,15 +690,14 @@ void m_draw(float width, float height)
                                cvar_set("g_campaign", "0");
                                m_sync();
                        }
-                       if (connected_time && time - connected_time > autocvar_menu_force_on_disconnection)
-                       {
+                       if (autocvar_menu_force_on_disconnection > 0)
                                m_toggle(true);
-                               connected_time = 0;
-                       }
+                       localcmd("\nmenu_cmd directmenu Welcome RESET\n");
+                       connected_time = 0;
                }
-               else
-                       connected_time = time;
        }
+       else
+               connected_time = time;
 
        m_gamestatus();