From 64faab26dccf00e2f5fd4d99e5518bd9f9e34f39 Mon Sep 17 00:00:00 2001 From: z411 Date: Tue, 30 May 2023 01:04:25 -0400 Subject: [PATCH] Fixed issues with bots --- qcsrc/server/teamplay.qc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index a012e7fc8..bc9a2652c 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -273,7 +273,7 @@ bool SetPlayerTeam(entity player, int team_index, int type) if (team_index != -1) { - if (IsQueueNeeded(player) && !SpectatorWantsJoin(player)) + if (!IS_BOT_CLIENT(player) && IsQueueNeeded(player) && !SpectatorWantsJoin(player)) { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(player.team, INFO_JOIN_WANTS_TEAM), player.netname); Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_JOIN_PREVENT_QUEUE); @@ -740,7 +740,7 @@ void TeamBalance_RemoveExcessPlayers(entity ignore) int latest_join = 0; entity latest_join_pl = NULL; - FOREACH_CLIENT(IS_CLIENT(it) || INGAME(it), { + FOREACH_CLIENT(IS_REAL_CLIENT(it) || INGAME(it), { if(it.team == Team_IndexToTeam(tmi) && CS(it).startplaytime > latest_join) { latest_join = CS(it).startplaytime; @@ -813,6 +813,10 @@ void TeamBalance_GetTeamCounts(entity balance, entity ignore) { continue; } + if (it.wants_join) + { + continue; // Queued players aren't actually in the game. + } int team_num; // TODO: Reconsider when the player is truly on the team. if (IS_CLIENT(it) || INGAME(it)) -- 2.39.2