[quake3-commits] r2251 - trunk/code/game

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun May 20 17:22:11 EDT 2012


Author: ztm
Date: 2012-05-20 17:22:11 -0400 (Sun, 20 May 2012)
New Revision: 2251

Modified:
   trunk/code/game/g_main.c
Log:
In CheckTeamLeader, make sure to only set one client as team leader. Reported by Tobias Kuehnhammer.

Modified: trunk/code/game/g_main.c
===================================================================
--- trunk/code/game/g_main.c	2012-05-08 20:27:24 UTC (rev 2250)
+++ trunk/code/game/g_main.c	2012-05-20 21:22:11 UTC (rev 2251)
@@ -1644,11 +1644,14 @@
 				break;
 			}
 		}
-		for ( i = 0 ; i < level.maxclients ; i++ ) {
-			if (level.clients[i].sess.sessionTeam != team)
-				continue;
-			level.clients[i].sess.teamLeader = qtrue;
-			break;
+
+		if (i >= level.maxclients) {
+			for ( i = 0 ; i < level.maxclients ; i++ ) {
+				if (level.clients[i].sess.sessionTeam != team)
+					continue;
+				level.clients[i].sess.teamLeader = qtrue;
+				break;
+			}
 		}
 	}
 }



More information about the quake3-commits mailing list