From: terencehill Date: Tue, 12 Apr 2022 16:36:18 +0000 (+0200) Subject: Campaign: reset the match on join so that timer is cleared and a nice 3 second countd... X-Git-Tag: xonotic-v0.8.5~77^2~2 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=aa2399ae4512fa9a9c1b7272b6b0b295b16f00c9;p=xonotic%2Fxonotic-data.pk3dir.git Campaign: reset the match on join so that timer is cleared and a nice 3 second countdown show up --- 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