From aa2399ae4512fa9a9c1b7272b6b0b295b16f00c9 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 12 Apr 2022 18:36:18 +0200 Subject: [PATCH] Campaign: reset the match on join so that timer is cleared and a nice 3 second countdown show up --- qcsrc/server/client.qc | 4 +++- qcsrc/server/command/vote.qc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 2c3bdc25c..e8482e6f5 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1973,6 +1973,9 @@ bool ShowTeamSelection(entity this) } void Join(entity this) { + if (autocvar_g_campaign && !campaign_bots_may_start && !game_stopped && time >= game_starttime) + ReadyRestart(true); + TRANSMUTE(Player, this); if(!this.team_selected) @@ -2557,7 +2560,6 @@ void PlayerPreThink (entity this) || (!(autocvar_sv_spectate || autocvar_g_campaign || (Player_GetForcedTeamIndex(this) == TEAM_FORCE_SPECTATOR)) && (!teamplay || autocvar_g_balance_teams))) { - campaign_bots_may_start = true; if(joinAllowed(this)) Join(this); return; diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index e94880c78..f0bd7c36b 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -439,6 +439,8 @@ void ReadyRestart_force(bool is_fake_round_start) if(warmup_stage) game_starttime = time; // Warmup: No countdown in warmup + else if (autocvar_g_campaign) + game_starttime = time + 3; else game_starttime = time + RESTART_COUNTDOWN; // Go into match mode -- 2.39.2