From 85006d75f52bba6c294d58e78df6c58908eede8c Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 27 Apr 2026 22:34:48 -0700
Subject: [PATCH] You don't lose your specials if you are rejuvenated at the
end of a wave
---
game/player.cpp | 17 +++++++++--------
game/player.h | 2 +-
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/game/player.cpp b/game/player.cpp
index 3c196ad5..c5715f84 100644
--- a/game/player.cpp
+++ b/game/player.cpp
@@ -144,8 +144,7 @@ Player::NewWave(void)
/* If we were exploding, rejuvenate us */
if ( Exploding || (!Alive() && Playing) ) {
- IncrLives(1);
- NewShip();
+ NewShip(false);
}
Bonus = INITIAL_BONUS;
BonusMult = 1;
@@ -176,7 +175,7 @@ Player::NewWave(void)
/* Returns the number of lives left */
int
-Player::NewShip(void)
+Player::NewShip(bool died)
{
if ( Lives == 0 ) {
if (gGameInfo.IsMultiplayer() && !gGameInfo.IsDeathmatch()) {
@@ -210,7 +209,7 @@ Player::NewShip(void)
Dead = 0;
Exploding = 0;
Set_TTL(-1);
- if ( ! gGameInfo.IsDeathmatch() ) {
+ if (died && !gGameInfo.IsDeathmatch()) {
if (Lives > 0) {
--Lives;
}
@@ -218,10 +217,12 @@ Player::NewShip(void)
UpdateCamera();
// We may lose our special abilities
- if ((special & LUCKY_IRISH) && (FastRandom(LUCK_ODDS) == 0)) {
- special &= ~LUCKY_IRISH;
- } else {
- special = 0;
+ if (died) {
+ if ((special & LUCKY_IRISH) && (FastRandom(LUCK_ODDS) == 0)) {
+ special &= ~LUCKY_IRISH;
+ } else {
+ special = 0;
+ }
}
// In Kid Mode you automatically get air brakes
diff --git a/game/player.h b/game/player.h
index eeb11d25..05299fe8 100644
--- a/game/player.h
+++ b/game/player.h
@@ -62,7 +62,7 @@ class Player : public Object {
void Continue(int lives);
virtual void NewWave(void);
/* NewShip() MUST be called before Move() */
- virtual int NewShip(void);
+ virtual int NewShip(bool died = true);
virtual int BeenShot(Object *ship, Shot *shot);
virtual int BeenRunOver(Object *ship);
virtual int BeenDamaged(int damage);