From 37ba9242ff5729780e8d3ad05deb5a30a5c7fec4 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 10 Feb 2012 14:01:54 +0100 Subject: [PATCH] don't start up with menu when a demo is played back --- qcsrc/menu/menu.qc | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 42b40568b..3d2121d1f 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -26,6 +26,17 @@ void m_sync() loadAllCvars(main); } +void m_gamestatus() +{ + gamestatus = 0; + if(isserver()) + gamestatus = gamestatus | GAME_ISSERVER; + if(clientstate() == CS_CONNECTED || isdemo()) + gamestatus = gamestatus | GAME_CONNECTED; + if(cvar("developer")) + gamestatus = gamestatus | GAME_DEVELOPER; +} + void m_init() { cvar_set("_menu_alpha", "0"); @@ -70,7 +81,11 @@ void m_init() localcmd("\nr_restart\n"); initConwidths(); - m_display(); + m_gamestatus(); + if(gamestatus & (GAME_ISSERVER | GAME_CONNECTED)) + m_hide(); + else + m_display(); } float MENU_ASPECT = 1.25; // 1280x1024 @@ -641,6 +656,8 @@ void m_draw() float t; float realFrametime; + m_gamestatus(); + execute_next_frame(); menuMouseMode = cvar("menu_mouse_absolute"); @@ -695,14 +712,6 @@ void m_draw() if(cvar("cl_capturevideo")) frametime = t / cvar("cl_capturevideo_fps"); // make capturevideo work smoothly - gamestatus = 0; - if(isserver()) - gamestatus = gamestatus | GAME_ISSERVER; - if(clientstate() == CS_CONNECTED) - gamestatus = gamestatus | GAME_CONNECTED; - if(cvar("developer")) - gamestatus = gamestatus | GAME_DEVELOPER; - prevMenuAlpha = menuAlpha; if(Menu_Active) { -- 2.39.2