mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-18 07:22:03 +00:00
More in-depth countdown calculation
Hooooopefully this makes sure time over doesn't happen prematurely at random
This commit is contained in:
parent
7dcc55951b
commit
7608055679
1 changed files with 22 additions and 13 deletions
|
@ -2003,19 +2003,6 @@ boolean P_CheckRacers(void)
|
||||||
countdown = countdown2 = 0;
|
countdown = countdown2 = 0;
|
||||||
return true;
|
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)
|
if (cv_karteliminatelast.value)
|
||||||
{
|
{
|
||||||
|
@ -2046,6 +2033,28 @@ boolean P_CheckRacers(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!countdown) // Check to see if the winners have finished, to set countdown.
|
||||||
|
{
|
||||||
|
UINT8 numingame = 0, numexiting = 0;
|
||||||
|
UINT8 winningpos = 1;
|
||||||
|
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if (!playeringame[i] || players[i].spectator)
|
||||||
|
continue;
|
||||||
|
numingame++;
|
||||||
|
if (players[i].exiting)
|
||||||
|
numexiting++;
|
||||||
|
}
|
||||||
|
|
||||||
|
winningpos = max(1, numingame/2);
|
||||||
|
if (numingame % 2) // any remainder?
|
||||||
|
winningpos++;
|
||||||
|
|
||||||
|
if (numexiting >= winningpos)
|
||||||
|
countdown = (((netgame || multiplayer) ? cv_countdowntime.value : 30)*TICRATE) + 1; // 30 seconds to finish, get going!
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue