Tweeked config handling lots. It's much more friendly now.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@746 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-01-07 02:44:12 +00:00
parent 517ba202a3
commit 2500f221c4

View file

@ -1171,6 +1171,12 @@ void CL_FullServerinfo_f (void)
char *p; char *p;
float v; float v;
if (!Cmd_FromServer())
{
Con_Printf("Hey! fullserverinfo is meant to come from the server!\n");
return;
}
if (Cmd_Argc() != 2) if (Cmd_Argc() != 2)
{ {
Con_TPrintf (TLC_SYNTAX_FULLSERVERINFO); Con_TPrintf (TLC_SYNTAX_FULLSERVERINFO);
@ -2739,6 +2745,9 @@ void Host_Init (quakeparms_t *parms)
Sys_Error ("Only %4.1f megs of memory reported, can't execute game", parms->memsize / (float)0x100000); Sys_Error ("Only %4.1f megs of memory reported, can't execute game", parms->memsize / (float)0x100000);
Memory_Init (parms->membase, parms->memsize); Memory_Init (parms->membase, parms->memsize);
COM_ParsePlusSets();
Cbuf_Init (); Cbuf_Init ();
Cmd_Init (); Cmd_Init ();
@ -2803,20 +2812,16 @@ void Host_Init (quakeparms_t *parms)
hrc = COM_FDepthFile("hexen.rc", true); hrc = COM_FDepthFile("hexen.rc", true);
def = COM_FDepthFile("default.cfg", true); def = COM_FDepthFile("default.cfg", true);
if (def < qrc && def < hrc || (qrc==0x7fffffff && hrc==0x7fffffff)) if (qrc >= def && qrc >= hrc && qrc!=0x7fffffff)
Cbuf_AddText ("exec quake.rc\n", RESTRICT_LOCAL);
else if (hrc >= def && hrc!=0x7fffffff)
Cbuf_AddText ("exec hexen.rc\n", RESTRICT_LOCAL);
else
{ //they didn't give us an rc file! { //they didn't give us an rc file!
Cbuf_AddText ("exec default.cfg\n", RESTRICT_LOCAL); Cbuf_AddText ("exec default.cfg\n", RESTRICT_LOCAL);
Cbuf_AddText ("exec config.cfg\n", RESTRICT_LOCAL); Cbuf_AddText ("exec config.cfg\n", RESTRICT_LOCAL);
Cbuf_AddText ("exec autoexec.cfg\n", RESTRICT_LOCAL); Cbuf_AddText ("exec autoexec.cfg\n", RESTRICT_LOCAL);
} }
else if (qrc < hrc)
{ //hello hexen2
Cbuf_AddText ("exec hexen.rc\n", RESTRICT_LOCAL);
}
else
{ //looks like they want us to run quake.
Cbuf_AddText ("exec quake.rc\n", RESTRICT_LOCAL);
}
Cbuf_AddText ("exec fte.cfg\n", RESTRICT_LOCAL); Cbuf_AddText ("exec fte.cfg\n", RESTRICT_LOCAL);
Cbuf_AddText ("cl_warncmd 1\n", RESTRICT_LOCAL); //and then it's allowed to start moaning. Cbuf_AddText ("cl_warncmd 1\n", RESTRICT_LOCAL); //and then it's allowed to start moaning.
@ -2827,8 +2832,10 @@ void Host_Init (quakeparms_t *parms)
host_initialized = true; host_initialized = true;
if (!setjmp (host_abort) ) Cmd_StuffCmds();
Cbuf_Execute (); //if the server initialisation causes a problem, give it a place to abort to
Cbuf_Execute (); //if the server initialisation causes a problem, give it a place to abort to
#ifndef NOMEDIA #ifndef NOMEDIA
if (!cls.demofile && !cls.state && !media_filmtype) if (!cls.demofile && !cls.state && !media_filmtype)
{ {