]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/menu.qc
Make togglemenu not close the menu if called when not connected. togglemenu 0 always...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / menu.qc
index 1edf6bfbaf261fbc59a3ba57dbe72d61bceba507..8bff8c4c67eec298b31f2ea589872a23575e6069 100644 (file)
@@ -920,6 +920,10 @@ void m_toggle(int mode)
        if (Menu_Active)
        {
                if (mode == 1) return;
+               // when togglemenu is called without arguments (mode is -1)
+               // the menu is closed only when connected
+               if (mode == -1 && !(gamestatus & GAME_CONNECTED)) return;
+               // togglemenu 0 always closes the menu
                m_hide();
        }
        else