From e03e1aff0cb240458ce45fb2b62e78de2a5f0999 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 30 Jun 2023 00:48:39 -0700 Subject: [PATCH] K_DropPowerUps: remove invincibilitytimer along with "S" --- src/k_powerup.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/k_powerup.cpp b/src/k_powerup.cpp index 59c95170b..3d1fcb312 100644 --- a/src/k_powerup.cpp +++ b/src/k_powerup.cpp @@ -1,5 +1,7 @@ /// \brief Battle mode power-up code +#include + #include "k_kart.h" #include "k_objects.h" #include "k_powerup.h" @@ -95,7 +97,15 @@ void K_DropPowerUps(player_t* player) auto& powerup = player->powerup; - drop(POWERUP_SMONITOR, [&] { powerup.superTimer = 0; }); + drop( + POWERUP_SMONITOR, [&] + { + // P_CheckInvincibilityTimer needs 1 tic to end the music + player->invincibilitytimer -= std::min(+powerup.superTimer, player->invincibilitytimer - 1); + powerup.superTimer = 0; + } + ); + drop(POWERUP_BARRIER, [&] { powerup.barrierTimer = 0; }); drop(POWERUP_BADGE, [&] { powerup.rhythmBadgeTimer = 0; }); drop(POWERUP_SUPERFLICKY, [&] { Obj_EndSuperFlickySwarm(powerup.flickyController); });