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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@797 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
svdijk 2013-02-01 20:06:52 +00:00
parent 62e3f20e24
commit 668a3c4959
2 changed files with 11 additions and 7 deletions

View file

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

View file

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