]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix HUD timer and infomessage support for g_warmup_limit -1 && (g_warmup -1 || g_warm...
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 24 Oct 2022 18:57:35 +0000 (04:57 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Fri, 6 Jan 2023 07:16:32 +0000 (17:16 +1000)
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/timer.qc

index e054bd94f05c3c091b02fbc435d22ea652051629..cfed7d7359dc410992f6cb3da25e0d9f389ad2f2 100644 (file)
@@ -152,13 +152,19 @@ void HUD_InfoMessages()
                else
                        blinkcolor = "^3";
 
+               int players_needed = 0;
                if(warmup_stage && STAT(WARMUP_TIMELIMIT) <= 0 && srv_minplayers)
                {
                        Scoreboard_UpdatePlayerTeams(); // ensure numplayers is current
-                       if(srv_minplayers - numplayers == 1)
+                       players_needed = srv_minplayers - numplayers;
+               }
+
+               if(players_needed > 0)
+               {
+                       if(players_needed == 1)
                                s = _("^31^2 more player is needed for the match to start.");
                        else
-                               s = sprintf(_("^3%d^2 more players are needed for the match to start."), srv_minplayers - numplayers);
+                               s = sprintf(_("^3%d^2 more players are needed for the match to start."), players_needed);
                        InfoMessage(s);
                }
                else if(ready_waiting && !spectatee_status)
index aa0c73b5bf90c4d08ea4e37d0d49cdb7f1ab460e..269d12b5edc800f9f2d50df6e7e70faad317bbb2 100644 (file)
@@ -125,7 +125,13 @@ void HUD_Timer()
                if (STAT(WARMUP_TIMELIMIT) > 0)
                        subtext = _("Warmup");
                else
-                       subtext = srv_minplayers ? _("Warmup: too few players") : _("Warmup: no time limit");
+               {
+                       Scoreboard_UpdatePlayerTeams(); // ensure numplayers is current
+                       if (srv_minplayers - numplayers > 0)
+                               subtext = _("Warmup: too few players");
+                       else
+                               subtext = _("Warmup: no time limit");
+               }
        }
        else if(STAT(TIMEOUT_STATUS) == 2)
                subtext = _("Timeout");