Skip to content

Commit

Permalink
Fix frame_msec possibly being zero in cl_input.c.
Browse files Browse the repository at this point in the history
This fixes a mouse freezing bug.
  • Loading branch information
SmileTheory committed Jan 30, 2016
1 parent 2b2f1ae commit 41791c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/client/cl_input.c
Expand Up @@ -632,6 +632,12 @@ void CL_CreateNewCommands( void ) {

frame_msec = com_frameTime - old_com_frameTime;

// if running over 1000fps, act as if each frame is 1ms
// prevents divisions by zero
if ( frame_msec < 1 ) {
frame_msec = 1;
}

// if running less than 5fps, truncate the extra time to prevent
// unexpected moves after a hitch
if ( frame_msec > 200 ) {
Expand Down

0 comments on commit 41791c6

Please sign in to comment.