- replaced NOBODY with TOTAL_SOLDIERS in range checks (NOBODY definition will be changed from 156 to -1 later)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1255 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2007-08-22 18:29:35 +00:00
parent cd8ad6e8b8
commit c656cffed5
6 changed files with 21 additions and 21 deletions
+13 -13
View File
@@ -1690,7 +1690,7 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
/*
if (ptr->guynum >= NOBODY)
if (ptr->guynum >= TOTAL_SOLDIERS)
{
#ifdef BETAVERSION
NumMessage("ManLooksForMan: ERROR - ptr->guynum = ",ptr->guynum);
@@ -1698,7 +1698,7 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
return(success);
}
if (oppPtr->guynum >= NOBODY)
if (oppPtr->guynum >= TOTAL_SOLDIERS)
{
#ifdef BETAVERSION
NumMessage("ManLooksForMan: ERROR - oppPtr->guynum = ",oppPtr->guynum);
@@ -1949,7 +1949,7 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 sOppGridno,
INT8 bOldOppList = pSoldier->bOppList[pOpponent->ubID];
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"ManSeesMan");
if (pSoldier->ubID >= NOBODY)
if (pSoldier->ubID >= TOTAL_SOLDIERS)
{
/*
#ifdef BETAVERSION
@@ -1959,7 +1959,7 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 sOppGridno,
return;
}
if (pOpponent->ubID >= NOBODY)
if (pOpponent->ubID >= TOTAL_SOLDIERS)
{
/*
#ifdef BETAVERSION
@@ -4906,7 +4906,7 @@ void MakeNoise(UINT8 ubNoiseMaker, INT16 sGridNo, INT8 bLevel, UINT8 ubTerrType,
}
else // EXPECTED noise
{
if (ubNoiseMaker < NOBODY)
if (ubNoiseMaker < TOTAL_SOLDIERS)
{
if (Menptr[ubNoiseMaker].controller == Net.pnum)
{
@@ -4993,7 +4993,7 @@ void OurNoise( UINT8 ubNoiseMaker, INT16 sGridNo, INT8 bLevel, UINT8 ubTerrType,
// see if anyone actually hears this noise, sees ubNoiseMaker, etc.
ProcessNoise(ubNoiseMaker, sGridNo, bLevel, ubTerrType, ubVolume, ubNoiseType);
if ((gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) && (ubNoiseMaker < NOBODY) && !gfDelayResolvingBestSightingDueToDoor )
if ((gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) && (ubNoiseMaker < TOTAL_SOLDIERS) && !gfDelayResolvingBestSightingDueToDoor )
{
pSoldier = MercPtrs[ubNoiseMaker];
@@ -5034,7 +5034,7 @@ void TheirNoise(UINT8 ubNoiseMaker, INT16 sGridNo, INT8 bLevel, UINT8 ubTerrType
ProcessNoise(ubNoiseMaker,sGridNo,bLevel,ubTerrType,ubVolume,ubNoiseType);
// if noiseMaker is SOMEBODY
if (ubNoiseMaker < NOBODY)
if (ubNoiseMaker < TOTAL_SOLDIERS)
{
/*
pSoldier = MercPtrs[ubNoiseMaker];
@@ -5097,7 +5097,7 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT16 sGridNo, INT8 bLevel, UINT8 ubTerrTy
// dead noiseMaker is only used here to decide WHICH soldiers HearNoise().
// if noise is made by a person, AND it's not noise from an explosion
if ((ubNoiseMaker < NOBODY) && (ubNoiseType != NOISE_EXPLOSION))
if ((ubNoiseMaker < TOTAL_SOLDIERS) && (ubNoiseType != NOISE_EXPLOSION))
{
// inactive/not in sector/dead soldiers, shouldn't be making noise!
if (!Menptr[ubNoiseMaker].bActive || !Menptr[ubNoiseMaker].bInSector ||
@@ -5175,7 +5175,7 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT16 sGridNo, INT8 bLevel, UINT8 ubTerrTy
}
// if a the noise maker is a person, not just NOBODY
if (ubNoiseMaker < NOBODY)
if (ubNoiseMaker < TOTAL_SOLDIERS)
{
// if this team is the same TEAM as the noise maker's
// (for now, assume we will report noises by unknown source on same SIDE)
@@ -5242,7 +5242,7 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT16 sGridNo, INT8 bLevel, UINT8 ubTerrTy
}
// if noise was made by a person
if (ubNoiseMaker < NOBODY)
if (ubNoiseMaker < TOTAL_SOLDIERS)
{
// if noisemaker has been *PUBLICLY* SEEN OR HEARD during THIS TURN
if ((gbPublicOpplist[bTeam][ubNoiseMaker] == SEEN_CURRENTLY) || // seen now
@@ -5296,7 +5296,7 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT16 sGridNo, INT8 bLevel, UINT8 ubTerrTy
}
// if a the noise maker is a person, not just NOBODY
if (ubNoiseMaker < NOBODY)
if (ubNoiseMaker < TOTAL_SOLDIERS)
{
// if this listener can see this noise maker
if (pSoldier->bOppList[ubNoiseMaker] == SEEN_CURRENTLY)
@@ -5445,7 +5445,7 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT16 sGridNo, INT8 bLevel, UINT8 ubTerrTy
// if the listening team is human-controlled AND
// the noise's source is another soldier
// (computer-controlled teams don't radio or automatically report NOISE)
if (gTacticalStatus.Team[bTeam].bHuman && (ubSource < NOBODY))
if (gTacticalStatus.Team[bTeam].bHuman && (ubSource < TOTAL_SOLDIERS))
{
// if ubNoiseMaker was seen by at least one member of this team
if (bSeen)
@@ -5742,7 +5742,7 @@ void HearNoise(SOLDIERTYPE *pSoldier, UINT8 ubNoiseMaker, UINT16 sGridNo, INT8 b
}
// if noise is made by a person
if (ubNoiseMaker < NOBODY)
if (ubNoiseMaker < TOTAL_SOLDIERS)
{
bOldOpplist = pSoldier->bOppList[ubNoiseMaker];