From 9e51255963e87d8aa82a7a4b61c7d84330c2b3e9 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 19 Nov 2018 22:37:24 -0500 Subject: [PATCH] Move countdown setting to P_CheckRacers This fixes two bugs: - Makes it so that the countdown happens when all the winners are ACTUALLY in instead of the first loser, because exiting timer wasn't set for the last winner in the place this was down before - Means that the countdown timer can be set on disconnect --- src/p_inter.c | 13 +++++++++++++ src/p_user.c | 17 ----------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 6a89159bd..baae2701f 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2003,6 +2003,19 @@ boolean P_CheckRacers(void) countdown = countdown2 = 0; return true; } + else if (!countdown) // Check to see if the winners have finished, to set countdown. + { + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i] || players[i].spectator) + continue; + if (players[i].exiting || K_IsPlayerLosing(&players[i])) // Only start countdown when all winners are declared + continue; + break; + } + if (i == MAXPLAYERS) + countdown = (((netgame || multiplayer) ? cv_countdowntime.value : 30)*TICRATE) + 1; // 30 seconds to finish, get going! + } if (cv_karteliminatelast.value) { diff --git a/src/p_user.c b/src/p_user.c index 616fc7215..b2849c857 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1778,23 +1778,6 @@ void P_DoPlayerExit(player_t *player) if (G_RaceGametype()) // If in Race Mode, allow { - if (!countdown) - { - UINT8 i; - - for (i = 0; i < MAXPLAYERS; i++) - { - if (!playeringame[i] || players[i].spectator) - continue; - if (players[i].exiting || K_IsPlayerLosing(&players[i])) // Only start countdown when all winners are declared - continue; - break; - } - - if (i == MAXPLAYERS) - countdown = (((netgame || multiplayer) ? cv_countdowntime.value : 30)*TICRATE) + 1; // 30 seconds to finish, get going! - } - if (cv_kartvoices.value) { if (P_IsLocalPlayer(player))