Resolve Battle score ties caused when Luigi wins by doing nothing.

This commit is contained in:
toaster 2022-03-07 14:12:58 +00:00
parent 4839586617
commit 723c479388

View file

@ -89,7 +89,7 @@ void K_CheckBumpers(void)
UINT8 i; UINT8 i;
UINT8 numingame = 0; UINT8 numingame = 0;
SINT8 winnernum = -1; SINT8 winnernum = -1;
INT32 winnerscoreadd = 0; INT32 winnerscoreadd = 0, maxroundscore = 0;
boolean nobumpers = false; boolean nobumpers = false;
if (!(gametyperules & GTR_BUMPERS)) if (!(gametyperules & GTR_BUMPERS))
@ -109,6 +109,11 @@ void K_CheckBumpers(void)
numingame++; numingame++;
winnerscoreadd += players[i].roundscore; winnerscoreadd += players[i].roundscore;
if (players[i].roundscore > maxroundscore)
{
maxroundscore = players[i].roundscore;
}
if (players[i].bumpers <= 0) // if you don't have any bumpers, you're probably not a winner if (players[i].bumpers <= 0) // if you don't have any bumpers, you're probably not a winner
{ {
nobumpers = true; nobumpers = true;
@ -157,6 +162,8 @@ void K_CheckBumpers(void)
if (winnernum > -1 && playeringame[winnernum]) if (winnernum > -1 && playeringame[winnernum])
{ {
if ((players[winnernum].roundscore+winnerscoreadd) == maxroundscore)
winnerscoreadd++; // break ties if luigi wins by doing nothing
players[winnernum].roundscore += winnerscoreadd; players[winnernum].roundscore += winnerscoreadd;
CONS_Printf(M_GetText("%s recieved %d point%s for winning!\n"), player_names[winnernum], winnerscoreadd, (winnerscoreadd == 1 ? "" : "s")); CONS_Printf(M_GetText("%s recieved %d point%s for winning!\n"), player_names[winnernum], winnerscoreadd, (winnerscoreadd == 1 ? "" : "s"));
} }