[iortcw] 25/152: All: Fix frame_msec possibly being zero in cl_input.c

Simon McVittie smcv at debian.org
Fri Sep 8 10:39:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.5a
in repository iortcw.

commit c7197dbe0a95802840e95f2244290dfc6cdc9e28
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Sat Jan 30 04:30:06 2016 -0500

    All: Fix frame_msec possibly being zero in cl_input.c
---
 MP/code/client/cl_input.c | 6 ++++++
 SP/code/client/cl_input.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/MP/code/client/cl_input.c b/MP/code/client/cl_input.c
index ffe0b08..04bf4ce 100644
--- a/MP/code/client/cl_input.c
+++ b/MP/code/client/cl_input.c
@@ -730,6 +730,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 ) {
diff --git a/SP/code/client/cl_input.c b/SP/code/client/cl_input.c
index d639f3c..3c2a5ee 100644
--- a/SP/code/client/cl_input.c
+++ b/SP/code/client/cl_input.c
@@ -704,6 +704,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 ) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list