diff --git a/src/k_kart.c b/src/k_kart.c index 2f84e84be..03dd6c79f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -401,7 +401,8 @@ static INT32 K_KartItemOddsBattle[NUMKARTRESULTS][2] = #define DISTVAR (2048) // Magic number distance for use with item roulette tiers -static INT32 K_SparkleTrailStartStates[NUMKARTSPARKLESTATES][2] = { +// Array of states to pick the starting point of the animation, based on the actual time left for invincibility. +static INT32 K_SparkleTrailStartStates[KART_NUMINVSPARKLESANIM][2] = { {S_KARTINVULN12, S_KARTINVULNB12}, {S_KARTINVULN11, S_KARTINVULNB11}, {S_KARTINVULN10, S_KARTINVULNB10}, @@ -3767,8 +3768,8 @@ void K_SpawnSparkleTrail(mobj_t *mo) const INT32 rad = (mo->radius*3)/FRACUNIT; mobj_t *sparkle; INT32 i; - UINT8 invanimnum; - INT32 invtime; + UINT8 invanimnum; // Current sparkle animation number + INT32 invtime;// Invincibility time left, in seconds UINT8 index = 1; fixed_t newx, newy, newz; diff --git a/src/k_kart.h b/src/k_kart.h index 95896f348..348ca84b7 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -11,7 +11,13 @@ #include "command.h" // Need for player_t #define KART_FULLTURN 800 -#define NUMKARTSPARKLESTATES 12 + +/* +Number of animations for the invincibility sparkles +If states are ever added or removed +Make sure this matches the actual number of states +*/ +#define KART_NUMINVSPARKLESANIM 12 player_t *K_GetItemBoxPlayer(mobj_t *mobj); angle_t K_ReflectAngle(angle_t angle, angle_t against, fixed_t maxspeed, fixed_t yourspeed);