]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
join queue: join all queued players when returning to warmup
authorbones_was_here <bones_was_here@xonotic.au>
Sat, 10 May 2025 10:09:14 +0000 (20:09 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 13 May 2025 08:19:49 +0000 (18:19 +1000)
Otherwise they're left in an inconsistent state because there's no
queueing when joining during warmup.

qcsrc/server/client.qc
qcsrc/server/command/vote.qc

index cb38762e6f0f6201195d6a65ea42a9682ceb0eaf..6273348803e2d42a50dbf0607aee55039fbd0b30 100644 (file)
@@ -2106,7 +2106,7 @@ void Join(entity this, bool queued_join)
                else if (this.wants_join)
                {
                        // Get queued player's attention
-                       if (game_starttime <= time) // No countdown in progress
+                       if (game_starttime <= time && !warmup_stage) // No countdown in progress and not returning to warmup with ReadyRestart
                                Send_Notification(NOTIF_ONE_ONLY, this, MSG_ANNCE, ANNCE_BEGIN);
                        Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, APP_TEAM_NUM(this.team, CENTER_JOIN_PLAY_TEAM));
                }
index e9153e5479bc3012dd945669b9a64a9ffb7b0f07..7ef38e535310965674474ccffb502945cbe62db1 100644 (file)
@@ -486,6 +486,16 @@ void ReadyRestart_force(bool is_fake_round_start)
                restart_timer.nextthink = game_starttime;
        }
 
+       // If we're returning to warmup join/switch all queued players for consistency:
+       // there's no queueing in warmup and imbalances are handled by sv_teamnagger blocking end of warmup.
+       if (warmup_stage)
+       {
+               // First pass: join player(s) queued for specific team(s)
+               FOREACH_CLIENT(it.wants_join > 0, Join(it, false));
+               // Second pass: join player(s) queued for team autoselection
+               FOREACH_CLIENT(it.wants_join < 0, Join(it, false));
+       }
+
        // after a restart every players number of allowed timeouts gets reset, too
        if (autocvar_sv_timeout)
        {