From: bones_was_here Date: Mon, 24 Oct 2022 18:57:35 +0000 (+1000) Subject: Fix HUD timer and infomessage support for g_warmup_limit -1 && (g_warmup -1 || g_warm... X-Git-Tag: xonotic-v0.8.6~179^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d0b3cee6dc12e62e7db192356fe17614ad1e650d;p=xonotic%2Fxonotic-data.pk3dir.git Fix HUD timer and infomessage support for g_warmup_limit -1 && (g_warmup -1 || g_warmup > 1) --- diff --git a/qcsrc/client/hud/panel/infomessages.qc b/qcsrc/client/hud/panel/infomessages.qc index e054bd94f..cfed7d735 100644 --- a/qcsrc/client/hud/panel/infomessages.qc +++ b/qcsrc/client/hud/panel/infomessages.qc @@ -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) diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index aa0c73b5b..269d12b5e 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -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");