Fix another potential index of sprite array by -1

This commit is contained in:
sirlemonhead 2019-11-30 15:14:24 +00:00 committed by Christoph Oelckers
parent ceccc0c2ee
commit 66e3a53991

View file

@ -1173,8 +1173,8 @@ void FuncPlayer(int pA, int nDamage, int nRun)
} }
else else
{ {
// ded // player has died
if (sprite[nSprite2].statnum == 100) if (nSprite2 > -1 && sprite[nSprite2].statnum == 100)
{ {
short nPlayer2 = GetPlayerFromSprite(nSprite2); short nPlayer2 = GetPlayerFromSprite(nSprite2);