|
|
@ -54,6 +54,8 @@ float rel_pitch; |
|
|
|
#define IMPULSE_DOWN 2 |
|
|
|
#define IMPULSE_DOWN 2 |
|
|
|
#define IMPULSE_UP 4 |
|
|
|
#define IMPULSE_UP 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool CL_IsDead(); |
|
|
|
|
|
|
|
Vector dead_viewangles(0, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
void IN_ToggleButtons( float forwardmove, float sidemove ) |
|
|
|
void IN_ToggleButtons( float forwardmove, float sidemove ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -152,51 +154,68 @@ void IN_ClientLookEvent( float relyaw, float relpitch ) |
|
|
|
void IN_Move( float frametime, usercmd_t *cmd ) |
|
|
|
void IN_Move( float frametime, usercmd_t *cmd ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Vector viewangles; |
|
|
|
Vector viewangles; |
|
|
|
gEngfuncs.GetViewAngles( viewangles ); |
|
|
|
|
|
|
|
bool fLadder = false; |
|
|
|
bool fLadder = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( gHUD.m_iIntermission ) |
|
|
|
|
|
|
|
return; // we can't move during intermission
|
|
|
|
|
|
|
|
|
|
|
|
if( cl_laddermode->value != 2 ) |
|
|
|
if( cl_laddermode->value != 2 ) |
|
|
|
fLadder = gEngfuncs.GetLocalPlayer()->curstate.movetype == MOVETYPE_FLY; |
|
|
|
{ |
|
|
|
//if( ac_forwardmove || ac_sidemove )
|
|
|
|
cl_entity_t *pplayer = gEngfuncs.GetLocalPlayer(); |
|
|
|
//gEngfuncs.Con_Printf( "Move: %f %f %f %f\n", ac_forwardmove, ac_sidemove, rel_pitch, rel_yaw );
|
|
|
|
if( pplayer ) |
|
|
|
|
|
|
|
fLadder = pplayer->curstate.movetype == MOVETYPE_FLY; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//if(ac_forwardmove || ac_sidemove)
|
|
|
|
|
|
|
|
//gEngfuncs.Con_Printf("Move: %f %f %f %f\n", ac_forwardmove, ac_sidemove, rel_pitch, rel_yaw);
|
|
|
|
#if 0 |
|
|
|
#if 0 |
|
|
|
if( in_mlook.state & 1 ) |
|
|
|
if( in_mlook.state & 1 ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
V_StopPitchDrift(); |
|
|
|
V_StopPitchDrift(); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
if( !gHUD.m_iIntermission ) |
|
|
|
if( CL_IsDead() ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( gHUD.GetSensitivity() != 0 ) |
|
|
|
viewangles = dead_viewangles; // HACKHACK: see below
|
|
|
|
{ |
|
|
|
} |
|
|
|
rel_yaw *= gHUD.GetSensitivity(); |
|
|
|
else |
|
|
|
rel_pitch *= gHUD.GetSensitivity(); |
|
|
|
{ |
|
|
|
} |
|
|
|
gEngfuncs.GetViewAngles( viewangles ); |
|
|
|
else |
|
|
|
} |
|
|
|
{ |
|
|
|
if( gHUD.GetSensitivity() != 0 ) |
|
|
|
rel_yaw *= sensitivity->value; |
|
|
|
{ |
|
|
|
rel_pitch *= sensitivity->value; |
|
|
|
rel_yaw *= gHUD.GetSensitivity(); |
|
|
|
} |
|
|
|
rel_pitch *= gHUD.GetSensitivity(); |
|
|
|
|
|
|
|
} |
|
|
|
viewangles[YAW] += rel_yaw; |
|
|
|
else |
|
|
|
if( fLadder ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
rel_yaw *= sensitivity->value; |
|
|
|
if( cl_laddermode->value == 1 ) |
|
|
|
rel_pitch *= sensitivity->value; |
|
|
|
viewangles[YAW] -= ac_sidemove * 5; |
|
|
|
} |
|
|
|
ac_sidemove = 0; |
|
|
|
viewangles[YAW] += rel_yaw; |
|
|
|
} |
|
|
|
if( fLadder ) |
|
|
|
if( gHUD.m_MOTD.m_bShow ) |
|
|
|
{ |
|
|
|
gHUD.m_MOTD.scroll += rel_pitch; |
|
|
|
if( cl_laddermode->value == 1 ) |
|
|
|
else |
|
|
|
viewangles[YAW] -= ac_sidemove * 5; |
|
|
|
|
|
|
|
ac_sidemove = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if( gHUD.m_MOTD.m_bShow ) |
|
|
|
|
|
|
|
gHUD.m_MOTD.scroll += rel_pitch; |
|
|
|
|
|
|
|
else |
|
|
|
viewangles[PITCH] += rel_pitch; |
|
|
|
viewangles[PITCH] += rel_pitch; |
|
|
|
if( viewangles[PITCH] > cl_pitchdown->value ) |
|
|
|
|
|
|
|
viewangles[PITCH] = cl_pitchdown->value; |
|
|
|
if( viewangles[PITCH] > cl_pitchdown->value ) |
|
|
|
if( viewangles[PITCH] < -cl_pitchup->value ) |
|
|
|
viewangles[PITCH] = cl_pitchdown->value; |
|
|
|
viewangles[PITCH] = -cl_pitchup->value; |
|
|
|
if( viewangles[PITCH] < -cl_pitchup->value ) |
|
|
|
|
|
|
|
viewangles[PITCH] = -cl_pitchup->value; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// HACKHACK: change viewangles directly in viewcode,
|
|
|
|
|
|
|
|
// so viewangles when player is dead will not be changed on server
|
|
|
|
|
|
|
|
if( !CL_IsDead() ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
gEngfuncs.SetViewAngles( viewangles ); |
|
|
|
} |
|
|
|
} |
|
|
|
float rgfl[3]; |
|
|
|
|
|
|
|
viewangles.CopyToArray( rgfl ); |
|
|
|
|
|
|
|
gEngfuncs.SetViewAngles( rgfl ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dead_viewangles = viewangles; // keep them actual
|
|
|
|
if( ac_movecount ) |
|
|
|
if( ac_movecount ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
IN_ToggleButtons( ac_forwardmove / ac_movecount, ac_sidemove / ac_movecount ); |
|
|
|
IN_ToggleButtons( ac_forwardmove / ac_movecount, ac_sidemove / ac_movecount ); |
|
|
@ -204,7 +223,7 @@ void IN_Move( float frametime, usercmd_t *cmd ) |
|
|
|
cmd->forwardmove = ac_forwardmove * cl_forwardspeed->value / ac_movecount; |
|
|
|
cmd->forwardmove = ac_forwardmove * cl_forwardspeed->value / ac_movecount; |
|
|
|
if( ac_sidemove ) |
|
|
|
if( ac_sidemove ) |
|
|
|
cmd->sidemove = ac_sidemove * cl_sidespeed->value / ac_movecount; |
|
|
|
cmd->sidemove = ac_sidemove * cl_sidespeed->value / ac_movecount; |
|
|
|
if(in_speed.state & 1) |
|
|
|
if( in_speed.state & 1 ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
cmd->forwardmove *= cl_movespeedkey->value; |
|
|
|
cmd->forwardmove *= cl_movespeedkey->value; |
|
|
|
cmd->sidemove *= cl_movespeedkey->value; |
|
|
|
cmd->sidemove *= cl_movespeedkey->value; |
|
|
|