summaryrefslogtreecommitdiff
path: root/src/client/cl_input.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2016-01-29 20:14:35 -0800
committerTim Angus <tim@ngus.net>2016-04-07 11:54:06 +0100
commit004db47aa205b6705ae11c86924eb63549127de6 (patch)
tree21a3f30ea2a67f2d66b31d146a881f8eae0b0fcb /src/client/cl_input.c
parent9f1aa0dfc09915681d66d16c6bce7768a280a08a (diff)
Fix frame_msec possibly being zero in cl_input.c.
This fixes a mouse freezing bug.
Diffstat (limited to 'src/client/cl_input.c')
-rw-r--r--src/client/cl_input.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/cl_input.c b/src/client/cl_input.c
index 48bf51df..7a917df2 100644
--- a/src/client/cl_input.c
+++ b/src/client/cl_input.c
@@ -633,6 +633,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 ) {