Skip to content

Commit

Permalink
- made patrolBonkles local to the only function using this array.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Oct 14, 2021
1 parent 71b1440 commit b64aede
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions source/games/blood/src/nnexts.cpp
Expand Up @@ -38,9 +38,6 @@ BEGIN_BLD_NS

inline int mulscale8(int a, int b) { return MulScale(a, b, 8); }

enum { kMaxPatrolFoundSounds = 256 }; // should be the maximum amount of sound channels the engine can play at the same time.
PATROL_FOUND_SOUNDS patrolBonkles[kMaxPatrolFoundSounds];

bool gAllowTrueRandom = false;
bool gEventRedirectsUsed = false;
DBloodActor* gProxySpritesList[]; // list of additional sprites which can be triggered by Proximity
Expand Down Expand Up @@ -255,15 +252,6 @@ CONDITION_TYPE_NAMES gCondTypeNames[7] = {

};

void nnExResetPatrolBonkles() {

for (int i = 0; i < kMaxPatrolFoundSounds; i++) {
patrolBonkles[i].snd = patrolBonkles[i].cur = 0;
patrolBonkles[i].max = ClipLow((gGameOptions.nDifficulty + 1) >> 1, 1);
}

}

// for actor.cpp
//-------------------------------------------------------------------------

Expand Down Expand Up @@ -7143,10 +7131,17 @@ bool readyForCrit(spritetype* pHunter, spritetype* pVictim) {

int aiPatrolSearchTargets(spritetype* pSprite, XSPRITE* pXSprite) {

enum { kMaxPatrolFoundSounds = 256 }; // should be the maximum amount of sound channels the engine can play at the same time.
PATROL_FOUND_SOUNDS patrolBonkles[kMaxPatrolFoundSounds];

assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type); PLAYER* pPlayer = NULL;

nnExResetPatrolBonkles();
for (int i = 0; i < kMaxPatrolFoundSounds; i++) {
patrolBonkles[i].snd = patrolBonkles[i].cur = 0;
patrolBonkles[i].max = ClipLow((gGameOptions.nDifficulty + 1) >> 1, 1);
}

int i, j, f, mod, x, y, z, dx, dy, nDist, eyeAboveZ, target = -1, sndCnt = 0, seeDist, hearDist, feelDist, seeChance, hearChance;
bool stealth = (pXSprite->unused1 & kDudeFlagStealth); bool blind = (pXSprite->dudeGuard); bool deaf = (pXSprite->dudeDeaf);

Expand Down

0 comments on commit b64aede

Please sign in to comment.