antilag_clear(this, CS(this));
- if (warmup_stage == -1)
+ if (warmup_stage < 0 || warmup_stage > 1)
ReadyCount();
}
WriteString(msg_type, autocvar_g_xonoticversion);
WriteByte(msg_type, CS(this).version_mismatch);
WriteByte(msg_type, (CS(this).version < autocvar_gameversion));
- WriteByte(msg_type, map_minplayers);
+ WriteByte(msg_type, autocvar_g_warmup > 1 ? autocvar_g_warmup : map_minplayers);
WriteByte(msg_type, GetPlayerLimit());
MUTATOR_CALLHOOK(BuildMutatorsPrettyString, "");
Nagger_ReadyCounted();
- if (t_players < map_minplayers) // map_minplayers will only be set if g_warmup -1 at worldspawn
+ // can't read warmup_stage here as it could have been set to 0 by ReadyRestart()
+ // and we need to use this when checking if we should abort the countdown
+ // 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 (game_starttime > time) // someone bailed during countdown, back to warmup
{
- warmup_stage = -1; // CAN change it AFTER calling Nagger_ReadyCounted() this frame
+ warmup_stage = autocvar_g_warmup; // CAN change it AFTER calling Nagger_ReadyCounted() this frame
game_starttime = time;
- Send_Notification(NOTIF_ALL, NULL, MSG_MULTI, COUNTDOWN_STOP, map_minplayers);
+ Send_Notification(NOTIF_ALL, NULL, MSG_MULTI, COUNTDOWN_STOP, minplayers);
}
if (warmup_limit > 0)
warmup_limit = -1;
return; // don't ReadyRestart if players are ready but too few
}
- else if (map_minplayers && warmup_limit <= 0)
+ else if (minplayers && warmup_limit <= 0)
{
// there's enough players now but we're still in infinite warmup
warmup_limit = cvar("g_warmup_limit");
set g_maxplayers_spectator_blocktime 5 "if the players voted for the \"nospectators\" command, this setting defines the number of seconds a observer/spectator has time to join the game before he gets kicked"
// tournament mod
-set g_warmup 0 "split the game into a warmup- and match-stage, -1 means stay in warmup until enough (set by map, lower bound of 2 or 2 per team) players join, then g_warmup_limit and readiness apply"
+set g_warmup 0 "splits the game into warmup and match stages, 1 means the match starts when g_warmup_majority_factor of players are ready OR g_warmup_limit is hit, >1 also requires at least g_warmup players (including bots) to join, -1 means that minimum player requrement is set by the map (lower bound of 2 or 2 per team)"
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"