]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make togglemenu not close the menu if called when not connected. togglemenu 0 always...
authorterencehill <piuntn@gmail.com>
Fri, 15 Mar 2024 00:00:08 +0000 (01:00 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 15 Mar 2024 00:00:08 +0000 (01:00 +0100)
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