From adb9547ba9eb7319dad55efa3b765d561fa627bb Mon Sep 17 00:00:00 2001 From: nukeykt Date: Mon, 26 Jul 2021 16:34:16 +0900 Subject: [PATCH] Blood: fix impact sprite OOB issue --- source/games/blood/src/actor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index d0dc5e143..86d5ee584 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -6096,7 +6096,10 @@ void actProcessSprites(void) else if (sprite[gImpactSpritesList[i]].sectnum < 0 || (sprite[gImpactSpritesList[i]].flags & kHitagFree) != 0) continue; - spritetype* pImpact = &sprite[gImpactSpritesList[i]]; XSPRITE* pXImpact = &xsprite[pImpact->extra]; + spritetype* pImpact = &sprite[gImpactSpritesList[i]]; + if (pImpact->extra <= 0) + continue; + XSPRITE* pXImpact = &xsprite[pImpact->extra]; if (/*pXImpact->state == pXImpact->restState ||*/ !TestBitString(v24c, pImpact->sectnum) || !CheckProximity(pImpact, x, y, z, nSector, radius)) continue;