1
0
Fork 0
forked from fte/fteqw

limit pitch/yaw fpd flags

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2352 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-07-17 17:33:35 +00:00
parent ba9a5440f0
commit 44f3d3361c

View file

@ -422,13 +422,9 @@ void CL_AdjustAngles (int pnum)
else else
speed = host_frametime; speed = host_frametime;
if (in_rotate && pnum==0) if (in_rotate && pnum==0 && !(cl.fpd & FPD_LIMIT_YAW))
{ {
quant = in_rotate; quant = in_rotate;
// if (quant < -800)
// quant = -800;
// else if (quant > 800)
// quant = 800;
if (!cl_instantrotate.value) if (!cl_instantrotate.value)
quant *= speed; quant *= speed;
in_rotate -= quant; in_rotate -= quant;
@ -437,15 +433,21 @@ void CL_AdjustAngles (int pnum)
if (!(in_strafe.state[pnum] & 1)) if (!(in_strafe.state[pnum] & 1))
{ {
cl.viewangles[pnum][YAW] -= speed*cl_yawspeed.value*CL_KeyState (&in_right, pnum); quant = cl_yawspeed.value;
cl.viewangles[pnum][YAW] += speed*cl_yawspeed.value*CL_KeyState (&in_left, pnum); if (cl.fpd & FPD_LIMIT_YAW)
quant = bound(-900, quant, 900);
cl.viewangles[pnum][YAW] -= speed*quant * CL_KeyState (&in_right, pnum);
cl.viewangles[pnum][YAW] += speed*quant * CL_KeyState (&in_left, pnum);
cl.viewangles[pnum][YAW] = anglemod(cl.viewangles[pnum][YAW]); cl.viewangles[pnum][YAW] = anglemod(cl.viewangles[pnum][YAW]);
} }
if (in_klook.state[pnum] & 1) if (in_klook.state[pnum] & 1)
{ {
V_StopPitchDrift (pnum); V_StopPitchDrift (pnum);
cl.viewangles[pnum][PITCH] -= speed*cl_pitchspeed.value * CL_KeyState (&in_forward, pnum); quant = cl_pitchspeed.value;
cl.viewangles[pnum][PITCH] += speed*cl_pitchspeed.value * CL_KeyState (&in_back, pnum); if (cl.fpd & FPD_LIMIT_PITCH)
quant = bound(-700, quant, 700);
cl.viewangles[pnum][PITCH] -= speed*quant * CL_KeyState (&in_forward, pnum);
cl.viewangles[pnum][PITCH] += speed*quant * CL_KeyState (&in_back, pnum);
} }
up = CL_KeyState (&in_lookup, pnum); up = CL_KeyState (&in_lookup, pnum);