diff --git a/src/d_player.h b/src/d_player.h index f52c89bdb..cb0d61288 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -668,8 +668,9 @@ struct player_t UINT16 rocketsneakertimer; // Rocket Sneaker duration timer - UINT16 invincibilitytimer; // Invincibility timer - UINT16 maxinvincibilitytime; // (Alternate) Initial time for Invincibility, used for the item bar. + UINT16 invincibilitytimer; // Invincibility timer + boolean shortinvin; // (Alternate) This Invincibility is too short to punish with bottleneckers, + UINT16 maxinvincibilitytime; // (Alternate) Initial time for Invincibility, used for the item bar. UINT16 invincibilitybottleneck; // (Alternate) Prevents breakaways by gradienting towards a heavier decrement. INT16 invincibilitycancel; // (Alternate) Duration of Invincibility canceling. UINT8 invincibilitywarning; // (Alternate) "Timer warning" boolean to signal Alt. Invin. is running out. diff --git a/src/k_kart.c b/src/k_kart.c index 630a1c428..ce13165ff 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2388,6 +2388,9 @@ UINT16 K_GetInvincibilityTime(player_t *player) UINT32 i, pingame; fixed_t distmul = FRACUNIT; + // ALWAYS reset shortinvin! + player->shortinvin = false; + if (!K_IsKartItemAlternate(KITEM_INVINCIBILITY)) return BASEINVINTIME; @@ -2418,7 +2421,15 @@ UINT16 K_GetInvincibilityTime(player_t *player) } fixed_t clustermul = K_InvincibilityEasing(FixedMul(player->distancefromcluster,distmul)); - return FixedMul(BASEINVINTIME, clustermul); + UINT16 invintics = FixedMul(BASEINVINTIME, clustermul); + + if (invintics <= MININVINTIME) + { + player->shortinvin = true; + invintics = MININVINTIME; + } + + return invintics; } #undef LEGACYALTINVINMUL diff --git a/src/k_kart.h b/src/k_kart.h index 2b7f842fe..902a2ffdc 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -33,6 +33,7 @@ Make sure this matches the actual number of states #define SHRINK_SCALE ((6*FRACUNIT)/8) #define BASEINVINTIME (10 * TICRATE) +#define MININVINTIME (7 * TICRATE) #define AUTORESPAWN_TIME (TICRATE/2) #define AUTORESPAWN_THRESHOLD (TICRATE/4)