Skip to content

Commit

Permalink
- do not try to retrieve data from an unchecked pointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Sep 10, 2021
1 parent 80101a5 commit 6cd9f26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/games/blood/src/aiunicult.cpp
Expand Up @@ -571,7 +571,6 @@ static void unicultThinkChase(DBloodActor* actor)
int weaponType = actor->genDudeExtra.weaponType;

auto actLeech = leechIsDropped(actor);
spritetype* pLeech = &actLeech->s();

const VECTORDATA* meleeVector = &gVectorData[22];
if (weaponType == kGenDudeWeaponThrow)
Expand Down Expand Up @@ -604,13 +603,14 @@ static void unicultThinkChase(DBloodActor* actor)
{
case kModernThingEnemyLifeLeech:
{
if (pLeech == NULL)
if (actLeech == NULL)
{
aiGenDudeNewState(actor, &genDudeThrow2);
genDudeThrow2.nextState = &genDudeDodgeShortL;
return;
}

spritetype* pLeech = &actLeech->s();
XSPRITE* pXLeech = &actLeech->x();
int ldist = aiFightGetTargetDist(targetactor, pDudeInfo, actLeech);
if (ldist > 3 || !cansee(pTarget->x, pTarget->y, pTarget->z, pTarget->sectnum,
Expand Down

0 comments on commit 6cd9f26

Please sign in to comment.