From d65f8679a78418ce86c6c57a1b81b5599528ef1c Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sat, 26 Jun 2010 08:45:40 +0000 Subject: [PATCH] host.c (Host_Init): Do not exec quake.rc for dedicated servers. Instead, exec autoexec.cfg and stuffcmds in that case. Also moved running the start map for dedicated servers here. host_cmd.c (Host_Startdemos_f): Moved running the start map for dedicated servers to Host_Init(). git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@234 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/host.c | 22 ++++++++++++++++------ Quake/host_cmd.c | 4 ---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Quake/host.c b/Quake/host.c index 221a15ae..f4ab9c43 100644 --- a/Quake/host.c +++ b/Quake/host.c @@ -852,20 +852,30 @@ void Host_Init (quakeparms_t *parms) CDAudio_Init (); Sbar_Init (); CL_Init (); + + Cbuf_InsertText ("exec quake.rc\n"); + // Cbuf_InsertText ("exec fitzquake.rc\n"); //johnfitz (inserted second so it'll be executed first) + + // johnfitz -- in case the vid mode was locked during vid_init, we can unlock it now. + // note: two leading newlines because the command buffer swallows one of them. + Cbuf_AddText ("\n\nvid_unlock\n"); } - Cbuf_InsertText ("exec quake.rc\n"); -// Cbuf_InsertText ("exec fitzquake.rc\n"); //johnfitz (inserted second so it'll be executed first) - - Cbuf_AddText ("\n\nvid_unlock\n"); //johnfitz -- in case the vid mode was locked during vid_init, we can unlock it now. - //note: added two newlines to the front becuase the command buffer swallows one of them. - Hunk_AllocName (0, "-HOST_HUNKLEVEL-"); host_hunklevel = Hunk_LowMark (); host_initialized = true; Con_Printf ("\n========= Quake Initialized =========\n\n"); //johnfitz - was Sys_Printf + + if (cls.state == ca_dedicated) + { + Cbuf_AddText ("exec autoexec.cfg\n"); + Cbuf_AddText ("stuffcmds"); + Cbuf_Execute (); + if (!sv.active) + Cbuf_AddText ("map start\n"); + } } diff --git a/Quake/host_cmd.c b/Quake/host_cmd.c index 2b3834fb..79dbaa9c 100644 --- a/Quake/host_cmd.c +++ b/Quake/host_cmd.c @@ -2134,11 +2134,7 @@ void Host_Startdemos_f (void) int i, c; if (cls.state == ca_dedicated) - { - if (!sv.active) - Cbuf_AddText ("map start\n"); return; - } c = Cmd_Argc() - 1; if (c > MAX_DEMOS)