]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
(SAME|DIFF)_TEAM: optimize
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 10 Dec 2015 05:46:27 +0000 (16:46 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 10 Dec 2015 05:46:27 +0000 (16:46 +1100)
qcsrc/common/teams.qh

index 074835d5e79c4914807f79ed60ab51137525c3f4..9fc5bdb18e631c1164ba7c582211336a4eb62764 100644 (file)
@@ -160,8 +160,8 @@ float Team_TeamToNumber(float teamid)
 #define TCR(input,teamcolor,teamtext) strreplace("^TC", teamcolor, strreplace("^TT", teamtext, input))
 
 // safe team comparisons
-#define SAME_TEAM(a,b) (teamplay ? ((a.team == b.team) ? 1 : 0) : ((a == b) ? 1 : 0))
-#define DIFF_TEAM(a,b) (teamplay ? ((a.team != b.team) ? 1 : 0) : ((a != b) ? 1 : 0))
+#define SAME_TEAM(a,b) (teamplay ? (a.team == b.team) : (a == b))
+#define DIFF_TEAM(a,b) (teamplay ? (a.team != b.team) : (a != b))
 
 // used for notification system multi-team identifiers
 #define APP_TEAM_NUM_2(num,prefix) ((num == NUM_TEAM_1) ? prefix##RED : prefix##BLUE)