From 6aecae38e6955d01daf0add692f6f132ef6fc6d2 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 18 Jan 2001 04:28:26 +0000 Subject: [PATCH] remove double command execution for 99.9% of the cases --- source/cl_main.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/source/cl_main.c b/source/cl_main.c index 1cf3c97..2c4436a 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -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) - Cmd_StuffCmds_f (); - Cbuf_Execute (); + if (check_quakerc ()) { + Cmd_StuffCmds_f (); + Cbuf_Execute (); + } Cbuf_InsertText ("exec quake.rc\n"); Cbuf_AddText