From 723c4793886067f64bf7eb005b96cb68cd4e980d Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 7 Mar 2022 14:12:58 +0000 Subject: [PATCH] Resolve Battle score ties caused when Luigi wins by doing nothing. --- src/k_battle.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/k_battle.c b/src/k_battle.c index 2ce12f95f..b526e0fb0 100644 --- a/src/k_battle.c +++ b/src/k_battle.c @@ -89,7 +89,7 @@ void K_CheckBumpers(void) UINT8 i; UINT8 numingame = 0; SINT8 winnernum = -1; - INT32 winnerscoreadd = 0; + INT32 winnerscoreadd = 0, maxroundscore = 0; boolean nobumpers = false; if (!(gametyperules & GTR_BUMPERS)) @@ -109,6 +109,11 @@ void K_CheckBumpers(void) numingame++; 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 { nobumpers = true; @@ -157,6 +162,8 @@ void K_CheckBumpers(void) if (winnernum > -1 && playeringame[winnernum]) { + if ((players[winnernum].roundscore+winnerscoreadd) == maxroundscore) + winnerscoreadd++; // break ties if luigi wins by doing nothing players[winnernum].roundscore += winnerscoreadd; CONS_Printf(M_GetText("%s recieved %d point%s for winning!\n"), player_names[winnernum], winnerscoreadd, (winnerscoreadd == 1 ? "" : "s")); }