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:
TehRealSalt committed 2018-11-19 22:37:24 -05:00
1 parent 20ac8ed126
commit 39e644a7f5
2 files changed
+13 -17

No files matched your search

+13
View File
@@ -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
View File
@@ -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))