]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Campaign: reset the match on join so that timer is cleared and a nice 3 second countd...
authorterencehill <piuntn@gmail.com>
Tue, 12 Apr 2022 16:36:18 +0000 (18:36 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 12 Apr 2022 16:36:18 +0000 (18:36 +0200)
qcsrc/server/client.qc
qcsrc/server/command/vote.qc

index 2c3bdc25ccf07e90931e1c0704cd09c44a0ffc71..e8482e6f52c2eaf4999920ffcf9e2ee0c716931f 100644 (file)
@@ -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;
index e94880c785164bf765deebbdf5eb77c56c5f2a75..f0bd7c36b7ce50953230f6177bda6e2236b9f9c5 100644 (file)
@@ -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