From d0df5dec7d3725d1d99287872d4ebc3a2ae37ee2 Mon Sep 17 00:00:00 2001 From: tmyqlfpir <80724828+tmyqlfpir@users.noreply.github.com> Date: Sun, 16 Jun 2024 10:51:06 +1000 Subject: [PATCH] Blood: Add range check for target extra index --- source/blood/src/aizomba.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blood/src/aizomba.cpp b/source/blood/src/aizomba.cpp index 8698b93e1f..028ac2a80b 100644 --- a/source/blood/src/aizomba.cpp +++ b/source/blood/src/aizomba.cpp @@ -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;