[iortcw] 43/89: All: Check delayed bot's team when counting bots for bot_minplayers

Simon McVittie smcv at debian.org
Fri Sep 8 10:44:24 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 1d2b137047ee7de6bbf9ed0356f0d62879b7f2fd
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Wed Jul 19 12:18:53 2017 -0400

    All: Check delayed bot's team when counting bots for bot_minplayers
---
 MP/code/game/g_bot.c | 15 ++++-----------
 SP/code/game/g_bot.c | 15 ++++-----------
 2 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/MP/code/game/g_bot.c b/MP/code/game/g_bot.c
index f97a53c..4158aae 100644
--- a/MP/code/game/g_bot.c
+++ b/MP/code/game/g_bot.c
@@ -311,16 +311,18 @@ int G_CountHumanPlayers( int team ) {
 /*
 ===============
 G_CountBotPlayers
+
+Check connected and connecting (delay join) bots.
 ===============
 */
 int G_CountBotPlayers( int team ) {
-	int i, n, num;
+	int i, num;
 	gclient_t   *cl;
 
 	num = 0;
 	for ( i = 0 ; i < g_maxclients.integer ; i++ ) {
 		cl = level.clients + i;
-		if ( cl->pers.connected != CON_CONNECTED ) {
+		if ( cl->pers.connected == CON_DISCONNECTED ) {
 			continue;
 		}
 		if ( !(g_entities[i].r.svFlags & SVF_BOT) ) {
@@ -331,15 +333,6 @@ int G_CountBotPlayers( int team ) {
 		}
 		num++;
 	}
-	for ( n = 0; n < BOT_SPAWN_QUEUE_DEPTH; n++ ) {
-		if ( !botSpawnQueue[n].spawnTime ) {
-			continue;
-		}
-		if ( botSpawnQueue[n].spawnTime > level.time ) {
-			continue;
-		}
-		num++;
-	}
 	return num;
 }
 
diff --git a/SP/code/game/g_bot.c b/SP/code/game/g_bot.c
index 370f3bb..b797a57 100644
--- a/SP/code/game/g_bot.c
+++ b/SP/code/game/g_bot.c
@@ -312,16 +312,18 @@ int G_CountHumanPlayers( int team ) {
 /*
 ===============
 G_CountBotPlayers
+
+Check connected and connecting (delay join) bots.
 ===============
 */
 int G_CountBotPlayers( int team ) {
-	int i, n, num;
+	int i, num;
 	gclient_t   *cl;
 
 	num = 0;
 	for ( i = 0 ; i < g_maxclients.integer ; i++ ) {
 		cl = level.clients + i;
-		if ( cl->pers.connected != CON_CONNECTED ) {
+		if ( cl->pers.connected == CON_DISCONNECTED ) {
 			continue;
 		}
 		if ( !(g_entities[i].r.svFlags & SVF_BOT) ) {
@@ -332,15 +334,6 @@ int G_CountBotPlayers( int team ) {
 		}
 		num++;
 	}
-	for ( n = 0; n < BOT_SPAWN_QUEUE_DEPTH; n++ ) {
-		if ( !botSpawnQueue[n].spawnTime ) {
-			continue;
-		}
-		if ( botSpawnQueue[n].spawnTime > level.time ) {
-			continue;
-		}
-		num++;
-	}
 	return num;
 }
 

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