From 9cbaaa2f110dbeeafc3dcd8e4024e8c4713612a2 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 25 Oct 2023 17:27:02 +0100 Subject: [PATCH] Defer owner->xtralife sound/animation not covered by Ring Total until Bonuses have been evaluated Makes more sense for Prison Break, accomodates weird combinatorial custom gametypes --- src/k_tally.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/k_tally.cpp b/src/k_tally.cpp index e3063a5e7..23347631f 100644 --- a/src/k_tally.cpp +++ b/src/k_tally.cpp @@ -658,21 +658,6 @@ boolean level_tally_t::IncrementLine(void) if (*value == dest) { // We've reached our destination - - if (lives_check == true) - { - // This is only true if Rings alone aren't responsible for our added lives. - // Generally for Prison Break, but could be earned in custom contexts too. - livesAdded = owner->xtralife; - xtraBlink = TICRATE; - - if (playSounds == true) - { - S_StopSoundByNum(sfx_cdfm73); - S_StartSound(NULL, sfx_cdfm73); - } - } - return true; } @@ -796,7 +781,24 @@ void level_tally_t::Tick(void) { if (IncrementLine() == true) { - if (playSounds) + if (grandprixinfo.gp == true // In GP + && lines >= lineCount // Finished the bonuses + && livesAdded < owner->xtralife // Didn't max out by other causes + ) + { + // This is only true if Rings alone aren't responsible for our added lives. + // Generally for Prison Break, but could be earned in custom contexts too. + livesAdded = owner->xtralife; + xtraBlink = TICRATE; + + if (playSounds == true) + { + S_StopSoundByNum(sfx_cdfm73); + S_StartSound(NULL, sfx_cdfm73); + } + } + + if (playSounds == true) { S_StopSoundByNum(sfx_mbs5b); S_StartSound(NULL, (lines >= lineCount) ? sfx_mbs70 : sfx_mbs5b);