[openjk] 25/32: MP CGame: Fix using qboolean as a non 0/1 type.

Simon McVittie smcv at debian.org
Sun Mar 12 18:03:04 UTC 2017


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

smcv pushed a commit to branch debian/master
in repository openjk.

commit 210c6a8ba81ce54be996077ee76b150701723266
Author: Ensiform <ensiform at gmail.com>
Date:   Sun Mar 12 09:30:06 2017 -0500

    MP CGame: Fix using qboolean as a non 0/1 type.
    
    On players, its used as 0-3. On bodies its used as 0/1. Fixes a warning.
---
 codemp/cgame/cg_ents.c       | 2 +-
 codemp/cgame/cg_local.h      | 2 +-
 codemp/cgame/cg_servercmds.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/codemp/cgame/cg_ents.c b/codemp/cgame/cg_ents.c
index 7c28f6c..5c790f5 100644
--- a/codemp/cgame/cg_ents.c
+++ b/codemp/cgame/cg_ents.c
@@ -1499,7 +1499,7 @@ Ghoul2 Insert End
 	{
 		if (cent->bodyFadeTime > cg.time)
 		{
-			qboolean lightSide = cent->teamPowerType;
+			qboolean lightSide = (cent->teamPowerType != 0) ? qtrue : qfalse;
 			vec3_t hitLoc, tempAng;
 			float tempLength;
 			int curTimeDif = ((cg.time + 60000) - cent->bodyFadeTime);
diff --git a/codemp/cgame/cg_local.h b/codemp/cgame/cg_local.h
index 490ec1c..4c7775d 100644
--- a/codemp/cgame/cg_local.h
+++ b/codemp/cgame/cg_local.h
@@ -432,7 +432,7 @@ typedef struct centity_s {
 	int				trickAlphaTime;
 
 	int				teamPowerEffectTime;
-	qboolean		teamPowerType; //0 regen, 1 heal, 2 drain, 3 absorb
+	int				teamPowerType; //0 regen, 1 heal, 2 drain, 3 absorb
 
 	qboolean		isRagging;
 	qboolean		ownerRagging;
diff --git a/codemp/cgame/cg_servercmds.c b/codemp/cgame/cg_servercmds.c
index 036a2c8..82f4e20 100644
--- a/codemp/cgame/cg_servercmds.c
+++ b/codemp/cgame/cg_servercmds.c
@@ -1445,9 +1445,9 @@ static void CG_RestoreClientGhoul_f( void ) {
 		body = &cg_entities[bodyIndex];
 
 		if ( side )
-			body->teamPowerType = qtrue; //light side
+			body->teamPowerType = 1; //light side
 		else
-			body->teamPowerType = qfalse; //dark side
+			body->teamPowerType = 0; //dark side
 
 		CG_BodyQueueCopy( body, clent->currentState.number, weaponIndex );
 	}

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



More information about the Pkg-games-commits mailing list