Merge branch 'invinc-state-crash' into 'master'

Fix invincibility related crash accessing array index out of bounds

See merge request KartKrew/Kart!423
This commit is contained in:
SteelT 2021-04-19 01:41:57 -04:00
commit c2f00d1a30

View file

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