Skip to content

Commit

Permalink
- fixed bad null check in aiProcessDudes.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Oct 11, 2021
1 parent c6dc564 commit f370c0f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/games/blood/src/ai.cpp
Expand Up @@ -1655,11 +1655,14 @@ void aiProcessDudes(void)

pXSprite->stateTimer = ClipLow(pXSprite->stateTimer - 4, 0);

if (pXSprite->aiState && pXSprite->aiState->moveFunc)
pXSprite->aiState->moveFunc(actor);
if (pXSprite->aiState)
{
if (pXSprite->aiState->moveFunc)
pXSprite->aiState->moveFunc(actor);

if (pXSprite->aiState->thinkFunc && (gFrameCount & 3) == (pSprite->index & 3)) // ouch, ouch! :(
pXSprite->aiState->thinkFunc(actor);
if (pXSprite->aiState->thinkFunc && (gFrameCount & 3) == (actor->GetIndex() & 3)) // ouch, ouch! :(
pXSprite->aiState->thinkFunc(actor);
}

switch (pSprite->type) {
#ifdef NOONE_EXTENSIONS
Expand Down

0 comments on commit f370c0f

Please sign in to comment.