From a2f0f236c6d98b811f3483c39290f84907ba8752 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 9 May 2005 13:03:18 +0000 Subject: [PATCH] fixed problems in the Host_Init Cbuf_InsertText stuff (by changing it to Cbuf_AddText, and some other cleanups) added Host_StartVideo to a few more places git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5253 d7cf8633-e32d-0410-b094-e92efae38249 --- cd_shared.c | 2 ++ cl_video.c | 2 ++ host.c | 34 ++++++++++++++++------------------ menu.c | 1 + 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/cd_shared.c b/cd_shared.c index 876a0a78..5d093e73 100644 --- a/cd_shared.c +++ b/cd_shared.c @@ -213,6 +213,8 @@ static void CD_f (void) int ret; int n; + Host_StartVideo(); + if (Cmd_Argc() < 2) return; diff --git a/cl_video.c b/cl_video.c index 8baebedd..cac5af69 100644 --- a/cl_video.c +++ b/cl_video.c @@ -268,6 +268,8 @@ static void CL_PlayVideo_f(void) { char name[1024]; + Host_StartVideo(); + if (Cmd_Argc() != 2) { Con_Print("usage: playvideo \nplays video named video/.dpv\n"); diff --git a/host.c b/host.c index fc4d8696..082e343b 100644 --- a/host.c +++ b/host.c @@ -184,7 +184,7 @@ void Host_ServerOptions (void) else { // default players in some games, singleplayer in most - if (gamemode != GAME_TRANSFUSION && gamemode != GAME_GOODVSBAD2 && gamemode != GAME_NEXUIZ && gamemode != GAME_BATTLEMECH) + if (gamemode != GAME_GOODVSBAD2 && gamemode != GAME_NEXUIZ && gamemode != GAME_BATTLEMECH) svs.maxclients = 1; } } @@ -998,23 +998,23 @@ void Host_Init (void) // set up the default startmap_sp and startmap_dm aliases (mods can // override these) and then execute the quake.rc startup script if (gamemode == GAME_NEHAHRA) - Cbuf_InsertText("alias startmap_sp \"map nehstart\"\nalias startmap_dm \"map nehstart\"\nexec quake.rc\n"); + Cbuf_AddText("alias startmap_sp \"map nehstart\"\nalias startmap_dm \"map nehstart\"\nexec quake.rc\n"); else if (gamemode == GAME_TRANSFUSION) - Cbuf_InsertText("alias startmap_sp \"map e1m1\"\n""alias startmap_dm \"map bb1\"\nexec quake.rc\n"); + Cbuf_AddText("alias startmap_sp \"map e1m1\"\n""alias startmap_dm \"map bb1\"\nexec quake.rc\n"); else if (gamemode == GAME_NEXUIZ) - Cbuf_InsertText("alias startmap_sp \"map nexdm01\"\nalias startmap_dm \"map nexdm01\"\nexec quake.rc\n"); + Cbuf_AddText("alias startmap_sp \"map nexdm01\"\nalias startmap_dm \"map nexdm01\"\nexec quake.rc\n"); else if (gamemode == GAME_TEU) - Cbuf_InsertText("alias startmap_sp \"map start\"\nalias startmap_dm \"map start\"\nexec teu.rc\n"); + Cbuf_AddText("alias startmap_sp \"map start\"\nalias startmap_dm \"map start\"\nexec teu.rc\n"); else - Cbuf_InsertText("alias startmap_sp \"map start\"\nalias startmap_dm \"map start\"\nexec quake.rc\n"); + Cbuf_AddText("alias startmap_sp \"map start\"\nalias startmap_dm \"map start\"\nexec quake.rc\n"); + Cbuf_Execute(); // if stuffcmds wasn't run, then quake.rc is probably missing, use default if (!host_stuffcmdsrun) - Cbuf_InsertText("exec default.cfg\nexec config.cfg\nexec autoexec.cfg\nstuffcmds\nstartdemos\n"); - - Cbuf_Execute(); - Cbuf_Execute(); - Cbuf_Execute(); + { + Cbuf_AddText("exec default.cfg\nexec config.cfg\nexec autoexec.cfg\nstuffcmds\n"); + Cbuf_Execute(); + } // save console log up to this point to log_file if it was set by configs Log_Start(); @@ -1025,25 +1025,23 @@ void Host_Init (void) if (i && i + 1 < com_argc) if (!sv.active && !cls.demoplayback && !cls.connect_trying) { - Cbuf_InsertText(va("timedemo %s\n", com_argv[i + 1])); + Cbuf_AddText(va("timedemo %s\n", com_argv[i + 1])); Cbuf_Execute(); } if (cls.state == ca_dedicated || COM_CheckParm("-listen")) if (!sv.active && !cls.demoplayback && !cls.connect_trying) { - Cbuf_InsertText("startmap_dm\n"); + Cbuf_AddText("startmap_dm\n"); Cbuf_Execute(); } if (!sv.active && !cls.demoplayback && !cls.connect_trying) { - Cbuf_InsertText("togglemenu\n"); if (gamemode == GAME_NEXUIZ) - { - Cbuf_InsertText("playvideo logo\n"); - Cbuf_InsertText("cd loop 1\n"); - } + Cbuf_AddText("togglemenu\nplayvideo logo\ncd loop 1\n"); + else + Cbuf_AddText("togglemenu\n"); Cbuf_Execute(); } diff --git a/menu.c b/menu.c index 0506b878..99e4dff6 100644 --- a/menu.c +++ b/menu.c @@ -4790,6 +4790,7 @@ void MR_Restart(void) void Call_MR_ToggleMenu_f(void) { + Host_StartVideo(); if(MR_ToggleMenu_f) MR_ToggleMenu_f(); } -- 2.39.2