From: bones_was_here Date: Mon, 26 Sep 2022 05:23:11 +0000 (+1000) Subject: Fix unnecessary inflation of g_warmup_majority_factor in some cases X-Git-Tag: xonotic-v0.8.6~348^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a6c88b6db4a45bae4d7c2d0b84a0dd95ebcd2f58;p=xonotic%2Fxonotic-data.pk3dir.git Fix unnecessary inflation of g_warmup_majority_factor in some cases For example with 10 players joined and g_warmup_majority_factor 0.8 the old code required 9 players to be ready, new code requires 8. Behaviour is unchanged when joined players * factor is not an integer. Also improve cvar description. --- diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 3367ef310..ecadba2ea 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -543,8 +543,8 @@ void ReadyCount() // warmup continues until enough players AND enough RUPs (no time limit) } - ready_needed_factor = bound(0.5, cvar("g_warmup_majority_factor"), 0.999); - ready_needed_count = floor(t_players * ready_needed_factor) + 1; + ready_needed_factor = bound(0.5, cvar("g_warmup_majority_factor"), 1); + ready_needed_count = ceil(t_players * ready_needed_factor); if (readycount >= ready_needed_count) ReadyRestart(true); } diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 572d89d7e..cd0a845d1 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -34,7 +34,7 @@ set g_warmup 0 "split the game into a warmup- and match-stage, -1 means stay in set g_warmup_limit 180 "limit warmup-stage to this time (in seconds); if set to -1 the warmup-stage is not affected by any timelimit, if set to 0 the usual timelimit also affects warmup-stage" set g_warmup_allow_timeout 0 "allow calling timeouts in the warmup-stage (if sv_timeout is set to 1)" set g_warmup_allguns 1 "provide more weapons on start while in warmup: 0 = normal start weapons, 1 = all guns available on the map, 2 = all normal weapons" -set g_warmup_majority_factor 0.8 "minimum percentage of players ready needed for warmup to end" +set g_warmup_majority_factor 0.8 "fraction of joined players sufficient to end warmup before g_warmup_limit by readying up" alias sv_hook_warmupend