mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-13 21:31:32 +00:00
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
This commit is contained in:
parent
20ac8ed126
commit
39e644a7f5
2 changed files with 13 additions and 17 deletions
|
@ -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)
|
||||
{
|
||||
|
|
17
src/p_user.c
17
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))
|
||||
|
|
Loading…
Reference in a new issue