Skip to content

Commit

Permalink
Fixed centerview command
Browse files Browse the repository at this point in the history
  • Loading branch information
pelya committed May 19, 2021
1 parent 40ad607 commit 5ed33af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions code/client/cl_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void IN_MLookDown( void ) {
void IN_MLookUp( void ) {
in_mlooking = qfalse;
if ( !cl_freelook->integer ) {
IN_CenterView ();
IN_CenterViewDown ();
}
}

Expand Down Expand Up @@ -413,7 +413,7 @@ void IN_Button14Down(void) {IN_KeyDown(&in_buttons[14]);}
void IN_Button14Up(void) {IN_KeyUp(&in_buttons[14]);}
void IN_Gesture(void) {in_buttons[3].wasPressed = qtrue;}

void IN_CenterView (void) {
void IN_CenterViewDown (void) {
//cl.viewangles[PITCH] = -SHORT2ANGLE(cl.snap.ps.delta_angles[PITCH]);
// User released joystick, then pressed the centerview button - it will rotate to the last joystick direction
if ( cl.joystickAxis[JOY_AXIS_SCREENJOY_X] == 0 && cl.joystickAxis[JOY_AXIS_SCREENJOY_Y] == 0 ) {
Expand All @@ -422,6 +422,9 @@ void IN_CenterView (void) {
}
}

void IN_CenterViewUp (void) {
}

//==========================================================================

cvar_t *cl_yawspeed;
Expand Down Expand Up @@ -1445,7 +1448,8 @@ CL_InitInput
============
*/
void CL_InitInput( void ) {
Cmd_AddCommand ("centerview",IN_CenterView);
Cmd_AddCommand ("+centerview",IN_CenterViewDown);
Cmd_AddCommand ("-centerview",IN_CenterViewUp);
Cmd_AddCommand ("+moveup",IN_UpDown);
Cmd_AddCommand ("-moveup",IN_UpUp);
Cmd_AddCommand ("+movedown",IN_DownDown);
Expand Down
3 changes: 2 additions & 1 deletion code/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@ void CL_ClearState (void);
void CL_ReadPackets (void);

void CL_WritePacket( void );
void IN_CenterView (void);
void IN_CenterViewDown (void);
void IN_CenterViewUp (void);

void CL_VerifyCode( void );

Expand Down

0 comments on commit 5ed33af

Please sign in to comment.