X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=host.c;h=060bbea771352ffa12236382c08349955f30b4cb;hb=e34cc10e2d07a5fb56002c3e4bb9cf871925b99b;hp=abb7f0483225dd5b7aec032d97171f93da4e5e86;hpb=56598acc94728f712285bfa8fba33c51593b0146;p=xonotic%2Fdarkplaces.git diff --git a/host.c b/host.c index abb7f048..060bbea7 100644 --- a/host.c +++ b/host.c @@ -220,15 +220,9 @@ Host_SaveConfig_f Writes key bindings and archived cvars to config.cfg =============== */ -void Host_SaveConfig_f(void) +void Host_SaveConfig_to(const char *file) { qfile_t *f; - const char *file = "config.cfg"; - - if(Cmd_Argc() >= 2) { - file = Cmd_Argv(1); - Con_Printf("Saving to %s\n", file); - } // dedicated servers initialize the host but don't parse and set the // config.cfg cvars @@ -238,7 +232,7 @@ void Host_SaveConfig_f(void) f = FS_Open (file, "wb", false, false); if (!f) { - Con_Print("Couldn't write config.cfg.\n"); + Con_Printf("Couldn't write %s.\n", file); return; } @@ -248,7 +242,21 @@ void Host_SaveConfig_f(void) FS_Close (f); } } +void Host_SaveConfig(void) +{ + Host_SaveConfig_to("config.cfg"); +} +void Host_SaveConfig_f(void) +{ + const char *file = "config.cfg"; + if(Cmd_Argc() >= 2) { + file = Cmd_Argv(1); + Con_Printf("Saving to %s\n", file); + } + + Host_SaveConfig_to(file); +} /* =============== @@ -865,7 +873,7 @@ void Host_Main(void) cl.csqc_usecsqclistener = false; } else - S_Update(&r_view.matrix); + S_Update(&r_refdef.view.matrix); CDAudio_Update(); @@ -1114,10 +1122,7 @@ static void Host_Init (void) if (!sv.active && !cls.demoplayback && !cls.connect_trying) { - if (gamemode == GAME_NEXUIZ) - Cbuf_AddText("togglemenu\nplayvideo logo\ncd loop 1\n"); - else - Cbuf_AddText("togglemenu\n"); + Cbuf_AddText("togglemenu\n"); Cbuf_Execute(); } @@ -1172,7 +1177,7 @@ void Host_Shutdown(void) #endif CL_Video_Shutdown(); - Host_SaveConfig_f(); + Host_SaveConfig(); CDAudio_Shutdown (); S_Terminate ();