// cannot reset the game while a timeout is active or pending
if (timeout_status) return;
- float ready_needed_factor, ready_needed_count;
- float t_players = 0;
+ int total_players = 0, human_players = 0, humans_ready = 0;
readycount = 0;
- FOREACH_CLIENT(IS_REAL_CLIENT(it) && (IS_PLAYER(it) || INGAME_JOINED(it)), {
- ++t_players;
+ FOREACH_CLIENT(IS_PLAYER(it) || INGAME_JOINED(it), {
+ ++total_players;
if (it.ready) ++readycount;
+ if (IS_REAL_CLIENT(it))
+ {
+ ++human_players;
+ if (it.ready) ++humans_ready;
+ }
});
Nagger_ReadyCounted();
// map_minplayers can only be > 0 if g_warmup was -1 at worldspawn
int minplayers = autocvar_g_warmup > 1 ? autocvar_g_warmup : map_minplayers;
- if (t_players < minplayers)
+ if (total_players < minplayers)
{
if (game_starttime > time) // someone bailed during countdown, back to warmup
{
// warmup continues until enough players AND enough RUPs (no time limit)
}
- 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);
+ if (humans_ready && humans_ready >= rint(human_players * bound(0.5, cvar("g_warmup_majority_factor"), 1)))
+ ReadyRestart(true);
}
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 "fraction of joined players sufficient to end warmup before g_warmup_limit by readying up"
+set g_warmup_majority_factor 0.8 "fraction of joined players (not including bots) sufficient to end warmup before g_warmup_limit by readying up"
alias sv_hook_warmupend