diff options
-rw-r--r-- | source/cl_input.c | 10 | ||||
-rw-r--r-- | source/cl_main.c | 17 |
2 files changed, 18 insertions, 9 deletions
diff --git a/source/cl_input.c b/source/cl_input.c index d346e9c..5802571 100644 --- a/source/cl_input.c +++ b/source/cl_input.c @@ -536,6 +536,8 @@ Build the intended movement vector ================ */ static void CL_BaseMove( vec3_t move ) { + float speed; + if( in_strafe.state & 1 ) { move[1] += cl_sidespeed->value * CL_KeyState( &in_right ); move[1] -= cl_sidespeed->value * CL_KeyState( &in_left ); @@ -552,12 +554,16 @@ static void CL_BaseMove( vec3_t move ) { move[0] -= cl_forwardspeed->value * CL_KeyState( &in_back ); } -// // adjust for speed key / running -// if( ( in_speed.state & 1 ) ^ cl_run->integer ) { VectorScale( move, 2, move ); } + +// clamp to server defined max speed + speed = cl.pmp.maxspeed; + clamp( move[0], -speed, speed ); + clamp( move[1], -speed, speed ); + clamp( move[2], -speed, speed ); } static void CL_ClampPitch( void ) { diff --git a/source/cl_main.c b/source/cl_main.c index c20ed13..b25d103 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -507,7 +507,7 @@ static void CL_PassiveConnect_f( void ) { static const char *CL_Connect_g( const char *partial, int state ) { static int length; static int index; - const char *adrstring; + cvar_t *var; char buffer[MAX_QPATH]; if( !state ) { @@ -515,15 +515,18 @@ static const char *CL_Connect_g( const char *partial, int state ) { index = 0; } - while( index < MAX_LOCAL_SERVERS ) { + while( index < 1024 ) { Com_sprintf( buffer, sizeof( buffer ), "adr%i", index ); index++; - adrstring = Cvar_VariableString( buffer ); - if( !adrstring[ 0 ] ) { + var = Cvar_FindVar( buffer ); + if( !var ) { + break; + } + if( !var->string[0] ) { continue; } - if( !strncmp( partial, adrstring, length ) ) { - return adrstring; + if( !strncmp( partial, var->string, length ) ) { + return var->string; } } @@ -1992,7 +1995,7 @@ static qboolean CL_WriteConfig( const char *path ) { FS_FOpenFile( path, &f, FS_MODE_WRITE ); if( !f ) { - Com_WPrintf( "Couldn't write %s\n", path ); + Com_WPrintf( "Couldn't open %s for writing\n", path ); return qfalse; } |