From 41791c662ff89e1edf7fdefe1e96428ccd7f93af Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Fri, 29 Jan 2016 20:14:35 -0800 Subject: [PATCH] Fix frame_msec possibly being zero in cl_input.c. This fixes a mouse freezing bug. --- code/client/cl_input.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/client/cl_input.c b/code/client/cl_input.c index 6669a406..296a7cc0 100644 --- a/code/client/cl_input.c +++ b/code/client/cl_input.c @@ -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 ) {