From: terencehill Date: Fri, 15 Mar 2024 00:00:08 +0000 (+0100) Subject: Make togglemenu not close the menu if called when not connected. togglemenu 0 always... X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=193a3864e9ac5b87cb4c8bf021db3e9a351554ed Make togglemenu not close the menu if called when not connected. togglemenu 0 always closes the menu even in this case --- diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 1edf6bfba..8bff8c4c6 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -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