]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fixed issues with bots
authorz411 <z411@omaera.org>
Tue, 30 May 2023 05:04:25 +0000 (01:04 -0400)
committerz411 <z411@omaera.org>
Tue, 30 May 2023 05:04:25 +0000 (01:04 -0400)
qcsrc/server/teamplay.qc

index a012e7fc89e0cb2a883d5b13ec23495678e44446..bc9a2652cb92d94b950c17798d10adf8b163dc8a 100644 (file)
@@ -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))