mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 06:42:26 +00:00
remove double command execution for 99.9% of the cases
This commit is contained in:
parent
f9e5db9aee
commit
6aecae38e6
1 changed files with 26 additions and 2 deletions
|
@ -1577,6 +1577,28 @@ Host_Frame (float time)
|
|||
|
||||
//============================================================================
|
||||
|
||||
static int
|
||||
check_quakerc (void)
|
||||
{
|
||||
QFile *f;
|
||||
char *l, *p;
|
||||
int ret = 1;
|
||||
|
||||
COM_FOpenFile ("quake.rc", &f);
|
||||
if (!f)
|
||||
return 1;
|
||||
while ((l = Qgetline (f))) {
|
||||
if ((p = strstr (l, "stuffcmds"))) {
|
||||
if (p == l) { // only known case so far
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Qclose (f);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
Host_Init
|
||||
|
@ -1697,8 +1719,10 @@ Host_Init (void)
|
|||
|
||||
// Reparse the command line for + commands.
|
||||
// (Note, no non-base commands exist yet)
|
||||
if (check_quakerc ()) {
|
||||
Cmd_StuffCmds_f ();
|
||||
Cbuf_Execute ();
|
||||
}
|
||||
|
||||
Cbuf_InsertText ("exec quake.rc\n");
|
||||
Cbuf_AddText
|
||||
|
|
Loading…
Reference in a new issue