From a32eb9e1b85189f3d6802bb3ab165e1f5ad49fb7 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 3 May 2000 11:34:57 +0000 Subject: [PATCH] common/cl_input.c: fix what looks like a bug. if (ms>250) ms=100; ??? common/cl_main.c common/cvars.h qw_client/cl_parse.c: put running autoexec.cfg back in, BUT now controlled by a cvar (cl_autoexec). --- common/cl_input.c | 2 +- common/cl_main.c | 3 +++ common/cvars.h | 3 ++- qw_client/cl_parse.c | 9 +++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/common/cl_input.c b/common/cl_input.c index 1480c25..9098a14 100644 --- a/common/cl_input.c +++ b/common/cl_input.c @@ -382,7 +382,7 @@ void CL_FinishMove (usercmd_t *cmd) // send milliseconds of time to apply the move ms = host_frametime * 1000; if (ms > 250) - ms = 100; // time was unreasonable + ms = 250; // time was unreasonable cmd->msec = ms; VectorCopy (cl.viewangles, cmd->angles); diff --git a/common/cl_main.c b/common/cl_main.c index dd7cc47..fba7e2b 100644 --- a/common/cl_main.c +++ b/common/cl_main.c @@ -102,6 +102,8 @@ cvar_t *rcon_password; cvar_t *rcon_address; cvar_t *cl_timeout; +cvar_t *cl_autoexec; + // these two are not intended to be set directly cvar_t *cl_name; cvar_t *cl_color; @@ -1730,6 +1732,7 @@ void CL_InitCvars() sys_nostdout = Cvar_Get ("sys_nostdout","0",0, "Toggles the display of console messages on the stdout stream"); + cl_autoexec = Cvar_Get ("cl_autoexec","0",CVAR_ROM,"exec autoexec.cfg on gamedir change"); cl_warncmd = Cvar_Get ("cl_warncmd","0",0,"None"); cl_name = Cvar_Get ("_cl_name","player",CVAR_ARCHIVE, "Sets the player name"); diff --git a/common/cvars.h b/common/cvars.h index 8bdb07d..117c6d1 100644 --- a/common/cvars.h +++ b/common/cvars.h @@ -31,8 +31,9 @@ #ifndef _CVARS_H #define _CVARS_H -extern cvar_t *gl_flashblend; +extern cvar_t *cl_autoexec; +extern cvar_t *gl_flashblend; // From r_local.h extern cvar_t *r_draworder; diff --git a/qw_client/cl_parse.c b/qw_client/cl_parse.c index f938640..b3c873d 100644 --- a/qw_client/cl_parse.c +++ b/qw_client/cl_parse.c @@ -590,6 +590,15 @@ void CL_ParseServerData (void) Cbuf_AddText ("exec frontend.cfg\n"); Cbuf_AddText ("cl_warncmd 1\n"); } + if (cl_autoexec->value) { + snprintf(fn, sizeof(fn), "%s/%s", com_gamedir, "autoexec.cfg"); + if ((f = Qopen(fn, "r")) != NULL) { + Qclose(f); + Cbuf_AddText ("cl_warncmd 0\n"); + Cbuf_AddText ("exec autoexec.cfg\n"); + Cbuf_AddText ("cl_warncmd 1\n"); + } + } } // parse player slot, high bit means spectator