mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
- 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:
+1
-1
@@ -1352,7 +1352,7 @@ INT32 FindBestPath(SOLDIERTYPE *s , INT16 sDestination, INT8 ubLevel, INT16 usMo
|
||||
// ATE: ONLY cancel if they are moving.....
|
||||
ubMerc = WhoIsThere2( (UINT16) newLoc, s->bLevel);
|
||||
|
||||
if ( ubMerc < NOBODY && ubMerc != s->ubID )
|
||||
if ( ubMerc < TOTAL_SOLDIERS && ubMerc != s->ubID )
|
||||
{
|
||||
// Check for movement....
|
||||
//if ( fTurnBased || ( (Menptr[ ubMerc ].sFinalDestination == Menptr[ ubMerc ].sGridNo) || (Menptr[ ubMerc ].fDelayedMovement) ) )
|
||||
|
||||
@@ -1155,7 +1155,7 @@ BOOLEAN StandardInterruptConditionsMet( SOLDIERTYPE * pSoldier, UINT8 ubOpponent
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if (ubOpponentID < NOBODY)
|
||||
if (ubOpponentID < TOTAL_SOLDIERS)
|
||||
{
|
||||
/*
|
||||
// only the OPPONENT'S controller's decision matters
|
||||
@@ -1177,7 +1177,7 @@ BOOLEAN StandardInterruptConditionsMet( SOLDIERTYPE * pSoldier, UINT8 ubOpponent
|
||||
else // no opponent, so controller of 'ptr' makes the call instead
|
||||
{
|
||||
// ALEX
|
||||
if (gsWhoThrewRock >= NOBODY)
|
||||
if (gsWhoThrewRock >= TOTAL_SOLDIERS)
|
||||
{
|
||||
#ifdef BETAVERSION
|
||||
NumMessage("StandardInterruptConditions: ERROR - ubOpponentID is NOBODY, don't know who threw rock, guynum = ",pSoldier->guynum);
|
||||
@@ -1299,7 +1299,7 @@ BOOLEAN StandardInterruptConditionsMet( SOLDIERTYPE * pSoldier, UINT8 ubOpponent
|
||||
ubMinPtsNeeded = AP_CHANGE_FACING;
|
||||
|
||||
// if the opponent is SOMEBODY
|
||||
if (ubOpponentID < NOBODY)
|
||||
if (ubOpponentID < TOTAL_SOLDIERS)
|
||||
{
|
||||
// if the soldiers are on the same side
|
||||
if (pSoldier->bSide == pOpponent->bSide)
|
||||
@@ -2029,7 +2029,7 @@ void ResolveInterruptsVs( SOLDIERTYPE * pSoldier, UINT8 ubInterruptType)
|
||||
}
|
||||
}
|
||||
|
||||
if (ubSmallestSlot < NOBODY)
|
||||
if (ubSmallestSlot < TOTAL_SOLDIERS)
|
||||
{
|
||||
// add this guy to everyone's interrupt queue
|
||||
AddToIntList(ubIntList[ubSmallestSlot],TRUE,TRUE);
|
||||
|
||||
@@ -4014,7 +4014,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, UINT16 sGridNo, UINT8 ubAimTime
|
||||
// add camo effects
|
||||
|
||||
#if 0
|
||||
if ((victim = WhoIsThere(sGridNo)) < NOBODY)
|
||||
if ((victim = WhoIsThere(sGridNo)) < TOTAL_SOLDIERS)
|
||||
{
|
||||
|
||||
// if victim is 5 or more tiles away and camouflaged, reduce
|
||||
|
||||
+13
-13
@@ -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];
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ void MakeClosestEnemyChosenOne()
|
||||
}
|
||||
|
||||
// if we found have an eligible enemy, make him our "chosen one"
|
||||
if (ubClosestEnemy < NOBODY)
|
||||
if (ubClosestEnemy < TOTAL_SOLDIERS)
|
||||
{
|
||||
gTacticalStatus.ubTheChosenOne = ubClosestEnemy; // flag him as the chosen one
|
||||
|
||||
|
||||
@@ -1853,7 +1853,7 @@ BOOLEAN ExpAffect( INT16 sBombGridNo, INT16 sGridNo, UINT32 uiDist, UINT16 usIte
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ( ubPerson = WhoIsThere2(sGridNo, bLevel ) ) >= NOBODY )
|
||||
if ( ( ubPerson = WhoIsThere2(sGridNo, bLevel ) ) >= TOTAL_SOLDIERS )
|
||||
{
|
||||
return( fRecompileMovementCosts );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user