From: Mario Date: Wed, 23 Sep 2015 23:19:47 +0000 (+1000) Subject: Don't use timeout if it's not set (fixes quickmenu not opening) X-Git-Tag: xonotic-v0.8.2~1920 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6611e7bd2a2664c8dd5d64c8d138955db472b552;p=xonotic%2Fxonotic-data.pk3dir.git Don't use timeout if it's not set (fixes quickmenu not opening) --- diff --git a/qcsrc/client/quickmenu.qc b/qcsrc/client/quickmenu.qc index 01667366e..44af6843b 100644 --- a/qcsrc/client/quickmenu.qc +++ b/qcsrc/client/quickmenu.qc @@ -173,7 +173,7 @@ bool QuickMenu_Open(string mode, string submenu) setcursormode(1); hudShiftState = 0; - QuickMenu_TimeOut = time + autocvar_hud_panel_quickmenu_time; + QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0); return true; } @@ -357,7 +357,7 @@ bool QuickMenu_Page_Load(string target_submenu, int new_page) QuickMenu_Close(); return false; } - QuickMenu_TimeOut = time + autocvar_hud_panel_quickmenu_time; + QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0); return true; } @@ -380,7 +380,7 @@ bool QuickMenu_ActionForNumber(int num) if (QuickMenu_Page_Command[num] != "") { localcmd(strcat("\n", QuickMenu_Page_Command[num], "\n")); - QuickMenu_TimeOut = time + autocvar_hud_panel_quickmenu_time; + QuickMenu_TimeOut = ((autocvar_hud_panel_quickmenu_time > 0) ? time + autocvar_hud_panel_quickmenu_time : 0); return true; } if (QuickMenu_Page_Description[num] != "") @@ -586,6 +586,7 @@ void HUD_QuickMenu(void) //if(!autocvar_hud_panel_quickmenu) return; if(!hud_panel_quickmenu) return; + if(QuickMenu_TimeOut) if(time > QuickMenu_TimeOut) { QuickMenu_Close();