Fix crash accessing array index out of bounds

This commit is contained in:
SteelT 2021-04-19 01:21:06 -04:00
parent 2cbd0d0dcc
commit a58a2dc58b

View file

@ -3836,7 +3836,7 @@ void K_SpawnSparkleTrail(mobj_t *mo)
INT32 i; INT32 i;
UINT8 invanimnum; // Current sparkle animation number UINT8 invanimnum; // Current sparkle animation number
INT32 invtime;// Invincibility time left, in seconds INT32 invtime;// Invincibility time left, in seconds
UINT8 index = 1; UINT8 index = 0;
fixed_t newx, newy, newz; fixed_t newx, newy, newz;
I_Assert(mo != NULL); I_Assert(mo != NULL);
@ -3850,7 +3850,7 @@ void K_SpawnSparkleTrail(mobj_t *mo)
} }
if (leveltime & 2) if (leveltime & 2)
index = 2; index = 1;
invtime = mo->player->kartstuff[k_invincibilitytimer]/TICRATE+1; invtime = mo->player->kartstuff[k_invincibilitytimer]/TICRATE+1;