Skip to content

Commit

Permalink
Merge pull request #822 from tmyqlfpir/fix-extra-field
Browse files Browse the repository at this point in the history
Blood: Add range check for target extra index
  • Loading branch information
Hendricks266 authored Jun 16, 2024
2 parents 36826c8 + d0df5de commit 067c08e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/blood/src/aizomba.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ static void thinkPonder(spritetype *pSprite, XSPRITE *pXSprite)
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
dassert(pXSprite->target >= 0 && pXSprite->target < kMaxSprites);
spritetype *pTarget = &sprite[pXSprite->target];
if (!VanillaMode() && !xspriRangeIsFine(pTarget->extra))
{
aiNewState(pSprite, pXSprite, &zombieASearch);
return;
}
XSPRITE *pXTarget = &xsprite[pTarget->extra];
int dx = pTarget->x-pSprite->x;
int dy = pTarget->y-pSprite->y;
Expand Down

0 comments on commit 067c08e

Please sign in to comment.