// ========================
set g_ctscup 0 "CTSCup: complete the stage, tournament edition"
set g_ctscup_minplayers 3 "how many players are required to start a tournament"
-set g_ctscup_warmup 10 "time players get to run around and learn the map before the tournament starts"
-set g_ctscup_finishwait 10 "after first finish wait this time before disqualifying players who haven't finished
-set g_ctscup_maxroundlength 60 "max time for each round. adjust for map length. used to protect against multiple trolls holding spectators hostage forever if spectators can not vote"
+set g_ctscup_warmup 90 "time players get to run around and learn the map before the tournament starts"
+set g_ctscup_finishwait 20 "after first finish wait this time before disqualifying players who haven't finished"
+set g_ctscup_maxroundlength 120 "max time for each round. adjust for map length. used to protect against multiple trolls holding spectators hostage forever if spectators can not vote"
// ==========================
// deathmatch (ffa or team)
-int roundCounter; // unused?
+int roundCounter; // how many rounds have there been
int roundPlayers; // amount of players currently in the game, does not include spectators
int nextRoundPlayers; // how many players should participate in the next round
bool tournamentStarted; // has the warmup ended
SaveSaveState(player);
}
}
+ else
+ {
+ race_PreparePlayer(player);
+ SaveSaveState(player);
+ }
}
// a player is made a spectator
if (roundFirstFinisherTime == 0)
roundFirstFinisherTime = time;
}
-
+
// softlock player's race checkpoint progress
// until next round, prevents 2nd laps and
// registering the better time out of those 2
}
// if the player were to be about to die, try to save them and restore a loadstate if possible
- else if (((GetResource(frag_target, RES_HEALTH) + GetResource(frag_target, RES_ARMOR)) - frag_damage) <= 0)
+ else if (tournamentStarted &&
+ (((GetResource(frag_target, RES_HEALTH) + GetResource(frag_target, RES_ARMOR)) - frag_damage) <= 0))
if (LoadSaveState(frag_target))
{
// if savestate loading was successful
PrintToChatAll(" \n");
PrintToChatAll("^3Not enough players! W A R M U P restarted! \n");
PrintToChatAll(" \n");
+ roundCounter = -1;
game_stopped = true;
round_handler_Init(0, 0.5, autocvar_g_ctscup_warmup);
return true;
PrintToChatAll(" \n");
PrintToChatAll("^3Everyone has a clear time! Ending warmup and starting the tournament! \n");
//PrintToChatAll(" \n");
- CTSCUP_TournamentStart();
+ roundCounter = -1;
game_stopped = true;
round_handler_Init(5, 1, autocvar_g_ctscup_maxroundlength);
return true;
{
CTSCUP_TournamentStart();
roundCounter++;
+ Score_ClearAll();
}
// respawn players
{
entity player = M_ARGV(0, entity);
- // mark round as started
- roundStarted = true;
+ // mark round as started if we're in a tournament
+ if (tournamentStarted)
+ roundStarted = true;
// do not register savestates with corpses that hit checkpoints
if (tournamentStarted && (GetResource(player, RES_HEALTH) >= 1))