]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix unnecessary inflation of g_warmup_majority_factor in some cases
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 26 Sep 2022 05:23:11 +0000 (15:23 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Wed, 28 Sep 2022 20:00:45 +0000 (06:00 +1000)
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.

qcsrc/server/command/vote.qc
xonotic-server.cfg

index 3367ef310c2e1eb5d97852b34964f1aa5188ab02..ecadba2ea83722417ec8c10bbc8b6e563026b10b 100644 (file)
@@ -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);
 }
index 572d89d7e1f360f95fe4cc92e532658abb68b97a..cd0a845d1f3eba5e77d44c2a0dd292b3fd3ffa8c 100644 (file)
@@ -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