// reset objectives, toggle spawnpoints, reset triggers, ...
void assault_new_round(entity this)
{
- //bprint("ASSAULT: new round\n");
-
// up round counter
this.winning = this.winning + 1;
// reset the level with a countdown
cvar_set("timelimit", ftos(ceil(time - AS_ROUND_DELAY - game_starttime) / 60));
- ReadyRestart_force(); // sets game_starttime
+ bprint("Starting second round...\n");
+ ReadyRestart_force(true); // sets game_starttime
}
entity as_round;
{
if(ent.winning) // round end has been triggered by attacking team
{
- bprint("Assault: round completed.\n");
+ bprint(Team_ColoredFullName(assault_attacker_team), " destroyed the objective in ", process_time(2, ceil(time - game_starttime)), "\n");
SetWinners(team, assault_attacker_team);
TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 666 - TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 0));
// =======================
// Resets the state of all clients, items, weapons, waypoints, ... of the map.
-void reset_map(bool dorespawn)
+void reset_map(bool dorespawn, bool is_fake_round_start)
{
if (time <= game_starttime)
{
if (game_stopped)
return;
- PlayerStats_GameReport_Reset_All();
+ if (!is_fake_round_start)
+ PlayerStats_GameReport_Reset_All();
if (round_handler_IsActive())
round_handler_Reset(game_starttime);
}
// Restarts the map after the countdown is over (and cvar sv_ready_restart_after_countdown is set)
void ReadyRestart_think(entity this)
{
- reset_map(true);
+ reset_map(true, false);
Score_ClearAll();
delete(this);
}
// Forces a restart of the game without actually reloading the map // this is a mess...
-void ReadyRestart_force()
+void ReadyRestart_force(bool is_fake_round_start)
{
if (time <= game_starttime && game_stopped)
return;
-
- bprint("^1Match is restarting...\n");
+ if (!is_fake_round_start)
+ bprint("^1Match is restarting...\n");
VoteReset();
if (checkrules_overtimesadded > 0 && g_race_qualifying != 2)
cvar_set("timelimit", ftos(autocvar_timelimit - (checkrules_overtimesadded * autocvar_timelimit_overtime)));
checkrules_suddendeathend = checkrules_overtimesadded = checkrules_suddendeathwarning = 0;
-
+
if(warmup_stage)
game_starttime = time; // Warmup: No countdown in warmup
else
});
// if we're ending the warmup stage call the corresponding hook
- if(!warmup_stage)
+ if(!is_fake_round_start && !warmup_stage)
localcmd("\nsv_hook_warmupend\n");
// reset the .ready status of all players (also spectators)
lockteams = !warmup_stage;
// initiate the restart-countdown-announcer entity
- if (sv_ready_restart_after_countdown && !warmup_stage)
+ if (!is_fake_round_start && sv_ready_restart_after_countdown && !warmup_stage)
{
entity restart_timer = new_pure(restart_timer);
setthink(restart_timer, ReadyRestart_think);
FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { CS(it).allowed_timeouts = autocvar_sv_timeout_number; });
}
- if (!sv_ready_restart_after_countdown || warmup_stage) reset_map(true);
+ if (!sv_ready_restart_after_countdown || warmup_stage) reset_map(true, is_fake_round_start);
if (autocvar_sv_eventlog) GameLogEcho(":restart");
}
else
warmup_stage = cvar("g_warmup"); // go into warmup if it's enabled, otherwise restart into match stage
- ReadyRestart_force();
+ ReadyRestart_force(false);
}
// Count the players who are ready and determine whether or not to restart the match
.int team_saved; // team number to restore upon map reset
.void(entity this) reset; // if set, an entity is reset using this
.void(entity this) reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
-void reset_map(float dorespawn);
+void reset_map(float dorespawn, bool is_fake_round_start);
void ReadyCount();
-void ReadyRestart_force();
+void ReadyRestart_force(bool is_fake_round_start);
void VoteCount(float first_count);
void Nagger_Init();