[iortcw] 35/89: All: Check for unlimited time power up using INT_MAX

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


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

smcv pushed a commit to tag 1.51b
in repository iortcw.

commit a73b906d97e2364e20e7b08f97d35b3e2f4fec0c
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Tue Jul 18 09:14:24 2017 -0400

    All: Check for unlimited time power up using INT_MAX
---
 MP/code/cgame/cg_newdraw.c | 11 ++++++++---
 SP/code/cgame/cg_draw.c    | 11 ++++++++---
 SP/code/cgame/cg_newdraw.c | 11 ++++++++---
 3 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/MP/code/cgame/cg_newdraw.c b/MP/code/cgame/cg_newdraw.c
index 54675ed..c561812 100644
--- a/MP/code/cgame/cg_newdraw.c
+++ b/MP/code/cgame/cg_newdraw.c
@@ -1421,10 +1421,15 @@ static void CG_DrawAreaPowerUp( rectDef_t *rect, int align, float spacing, float
 		if ( !ps->powerups[ i ] ) {
 			continue;
 		}
-		t = ps->powerups[ i ] - cg.time;
-		// ZOID--don't draw if the power up has unlimited time (999 seconds)
+
+		// ZOID--don't draw if the power up has unlimited time
 		// This is true of the CTF flags
-		if ( t <= 0 || t >= 999000 ) {
+		if ( ps->powerups[ i ] == INT_MAX ) {
+			continue;
+		}
+
+		t = ps->powerups[ i ] - cg.time;
+		if ( t <= 0 ) {
 			continue;
 		}
 
diff --git a/SP/code/cgame/cg_draw.c b/SP/code/cgame/cg_draw.c
index 2d0d90f..2a331fc 100644
--- a/SP/code/cgame/cg_draw.c
+++ b/SP/code/cgame/cg_draw.c
@@ -1395,10 +1395,15 @@ static float CG_DrawPowerups( float y ) {
 		if ( !ps->powerups[ i ] ) {
 			continue;
 		}
-		t = ps->powerups[ i ] - cg.time;
-		// ZOID--don't draw if the power up has unlimited time (999 seconds)
+
+		// ZOID--don't draw if the power up has unlimited time
 		// This is true of the CTF flags
-		if ( t < 0 || t > 999000 ) {
+		if ( ps->powerups[ i ] == INT_MAX ) {
+			continue;
+		}
+
+		t = ps->powerups[ i ] - cg.time;
+		if ( t <= 0 ) {
 			continue;
 		}
 
diff --git a/SP/code/cgame/cg_newdraw.c b/SP/code/cgame/cg_newdraw.c
index ed93c30..c5ec4cc 100644
--- a/SP/code/cgame/cg_newdraw.c
+++ b/SP/code/cgame/cg_newdraw.c
@@ -1358,10 +1358,15 @@ static void CG_DrawAreaPowerUp( rectDef_t *rect, int align, float spacing, int f
 		if ( !ps->powerups[ i ] ) {
 			continue;
 		}
-		t = ps->powerups[ i ] - cg.time;
-		// ZOID--don't draw if the power up has unlimited time (999 seconds)
+
+		// ZOID--don't draw if the power up has unlimited time
 		// This is true of the CTF flags
-		if ( t <= 0 || t >= 999000 ) {
+		if ( ps->powerups[ i ] == INT_MAX ) {
+			continue;
+		}
+
+		t = ps->powerups[ i ] - cg.time;
+		if ( t <= 0 ) {
 			continue;
 		}
 

-- 
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