Make the "speedkey" act as "slowkey" when "always run" is on.

A bit of a hack, this should really be controlled by a
separate "cl_alwaysrun" cvar, but lets stick to this for
backward compatibility for now.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@797 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Sander van Dijk 2013-02-01 20:06:52 +00:00
parent 48e884e8fe
commit a86fc9a175
2 changed files with 11 additions and 7 deletions

View file

@ -246,7 +246,7 @@ void CL_AdjustAngles (void)
float speed;
float up, down;
if (in_speed.state & 1)
if ((cl_forwardspeed.value > 200) ^ (in_speed.state & 1))
speed = host_frametime * cl_anglespeedkey.value;
else
speed = host_frametime;
@ -324,7 +324,11 @@ void CL_BaseMove (usercmd_t *cmd)
//
// adjust for speed key
//
if (in_speed.state & 1)
if (cl_forwardspeed.value > 200 && cl_movespeedkey.value != 0)
{
cmd->forwardmove /= cl_movespeedkey.value;
}
if ((cl_forwardspeed.value > 200) ^ (in_speed.state & 1))
{
cmd->forwardmove *= cl_movespeedkey.value;
cmd->sidemove *= cl_movespeedkey.value;

View file

@ -1037,15 +1037,15 @@ void M_AdjustSliders (int dir)
break;
case OPT_ALWAYRUN: // always run
if (cl_forwardspeed.value > 200)
if (cl_forwardspeed.value > 200 || cl_movespeedkey.value <= 1)
{
Cvar_Set ("cl_forwardspeed", "200");
Cvar_Set ("cl_backspeed", "200");
Cvar_SetValue ("cl_forwardspeed", 200);
Cvar_SetValue ("cl_backspeed", 200);
}
else
{
Cvar_Set ("cl_forwardspeed", "400");
Cvar_Set ("cl_backspeed", "400");
Cvar_SetValue ("cl_forwardspeed", 200 * cl_movespeedkey.value);
Cvar_SetValue ("cl_backspeed", 200 * cl_movespeedkey.value);
}
break;