Maelstrom: Fixed getting multiple lives during the bonus countdown

From 58580595fd3f55c423b757123835cbfc89c6c397 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 21 Apr 2026 07:29:16 -0700
Subject: [PATCH] Fixed getting multiple lives during the bonus countdown

Fixes https://github.com/libsdl-org/Maelstrom/issues/34
---
 game/game.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/game/game.cpp b/game/game.cpp
index 545b5645..b5d8fc60 100644
--- a/game/game.cpp
+++ b/game/game.cpp
@@ -985,13 +985,13 @@ GamePanelDelegate::DrawStatus(Bool first)
 
 			/* -- See if they got a new life */
 			lastScores[i] = Score;
-			if ((Score - lastLife[i]) >= NEW_LIFE) {
+			while ((Score - lastLife[i]) >= NEW_LIFE) {
 				if (!gPlayers[i]->IsGhost()) {
 					gPlayers[i]->IncrLives(1);
-					if ( gGameInfo.IsLocalPlayer(i) )
+					if ( i == gDisplayed )
 						sound->PlaySound(gNewLife, 5);
 				}
-				lastLife[i] = (Score / NEW_LIFE) * NEW_LIFE;
+				lastLife[i] += NEW_LIFE;
 			}
 		}
 	}
@@ -1397,6 +1397,7 @@ GamePanelDelegate::BonusCountdown()
 			SDL_snprintf(numbuf, sizeof(numbuf), "%-5.1d", TheShip->GetScore());
 			score->SetText(numbuf);
 		}
+		DrawStatus(false);
 		DelaySound();
 		return;
 	}