mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Use macro where appropriate for easier maintenance
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8847 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -730,7 +730,7 @@ void BuildSectorsWithSoldiersList( void )
|
||||
{
|
||||
if(pTeamSoldier->bActive)
|
||||
{
|
||||
fSectorsWithSoldiers[ pTeamSoldier->sSectorX + pTeamSoldier->sSectorY * MAP_WORLD_X ][ pTeamSoldier->bSectorZ ] = TRUE;
|
||||
fSectorsWithSoldiers[ CALCULATE_STRATEGIC_INDEX(pTeamSoldier->sSectorX, pTeamSoldier->sSectorY ) ][ pTeamSoldier->bSectorZ ] = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2932,7 +2932,7 @@ void UpdateAssignments()
|
||||
for( bZ = 0; bZ < 4; ++bZ )
|
||||
{
|
||||
// is there anyone in this sector?
|
||||
if( fSectorsWithSoldiers[ sX + sY * MAP_WORLD_X ][ bZ ] == TRUE )
|
||||
if( fSectorsWithSoldiers[CALCULATE_STRATEGIC_INDEX(sX, sY) ][ bZ ] == TRUE )
|
||||
{
|
||||
// handle any doctors
|
||||
HandleDoctorsInSector( sX, sY, bZ );
|
||||
@@ -4672,7 +4672,7 @@ void CheckForAndHandleHospitalPatients( void )
|
||||
SOLDIERTYPE *pSoldier, *pTeamSoldier;
|
||||
INT32 cnt=0;
|
||||
|
||||
if ( fSectorsWithSoldiers[gModSettings.ubHospitalSectorX + gModSettings.ubHospitalSectorY * MAP_WORLD_X][0] == FALSE )
|
||||
if ( fSectorsWithSoldiers[CALCULATE_STRATEGIC_INDEX(gModSettings.ubHospitalSectorX, gModSettings.ubHospitalSectorY )][0] == FALSE )
|
||||
{
|
||||
// nobody in the hospital sector... leave
|
||||
return;
|
||||
@@ -6060,7 +6060,7 @@ void HandleTrainingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ )
|
||||
}
|
||||
|
||||
// check if we're doing a sector where militia can be trained
|
||||
if( ( (StrategicMap[ sMapX + ( sMapY * MAP_WORLD_X ) ].bNameId != BLANK_SECTOR ) || ( fSamSiteInSector == TRUE ) ) && (bZ == 0) )
|
||||
if( ( (StrategicMap[CALCULATE_STRATEGIC_INDEX(sMapX, sMapY) ].bNameId != BLANK_SECTOR ) || ( fSamSiteInSector == TRUE ) ) && (bZ == 0) )
|
||||
{
|
||||
// init town trainer list
|
||||
memset( TownTrainer, 0, sizeof( TownTrainer ) );
|
||||
@@ -7798,7 +7798,7 @@ BOOLEAN TrainTownInSector( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMapY, INT1
|
||||
BOOLEAN fSamSiteInSector = IsThisSectorASAMSector( sMapX, sMapY, 0 );
|
||||
|
||||
// get town index
|
||||
ubTownId = StrategicMap[ pTrainer->sSectorX + pTrainer->sSectorY * MAP_WORLD_X ].bNameId;
|
||||
ubTownId = StrategicMap[CALCULATE_STRATEGIC_INDEX(pTrainer->sSectorX, pTrainer->sSectorY ) ].bNameId;
|
||||
if( fSamSiteInSector == FALSE )
|
||||
{
|
||||
AssertNE(ubTownId, BLANK_SECTOR);
|
||||
@@ -8595,7 +8595,7 @@ void HandlePrison( INT16 sMapX, INT16 sMapY, INT8 bZ )
|
||||
GetShortSectorString( sMapX, sMapY, wSectorName );
|
||||
|
||||
// if sector is not under our control, the prisoners are added to the local garrison
|
||||
if( StrategicMap[ sMapX + sMapY * MAP_WORLD_X ].fEnemyControlled == TRUE )
|
||||
if( StrategicMap[ CALCULATE_STRATEGIC_INDEX(sMapX, sMapY) ].fEnemyControlled == TRUE )
|
||||
{
|
||||
// add enemies
|
||||
pSectorInfo->ubNumTroops = min( 255, pSectorInfo->ubNumTroops + aPrisoners[PRISONER_REGULAR] );
|
||||
@@ -8975,7 +8975,7 @@ void HandleTrainWorkers()
|
||||
if ( !SectorOursAndPeaceful( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ) )
|
||||
continue;
|
||||
|
||||
UINT8 ubTownId = StrategicMap[ pSoldier->sSectorX + pSoldier->sSectorY * MAP_WORLD_X ].bNameId;
|
||||
UINT8 ubTownId = StrategicMap[ CALCULATE_STRATEGIC_INDEX(pSoldier->sSectorX, pSoldier->sSectorY) ].bNameId;
|
||||
|
||||
// Flugente: adjust for workforce
|
||||
UINT16 maxworkforce = 0;
|
||||
@@ -17888,7 +17888,7 @@ BOOLEAN PutMercInAwakeState( SOLDIERTYPE *pSoldier )
|
||||
|
||||
BOOLEAN IsThereASoldierInThisSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
||||
{
|
||||
if( fSectorsWithSoldiers[ sSectorX + sSectorY * MAP_WORLD_X ][ bSectorZ ] == TRUE )
|
||||
if( fSectorsWithSoldiers[CALCULATE_STRATEGIC_INDEX(sSectorX, sSectorY)][ bSectorZ ] == TRUE )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -2409,7 +2409,7 @@ BOOLEAN WillAirRaidBeStopped( INT16 sSectorX, INT16 sSectorY )
|
||||
{
|
||||
UINT8 ubChance;
|
||||
|
||||
if ( !StrategicMap[(AIRPORT_X + (MAP_WORLD_X * AIRPORT_Y))].fEnemyControlled && !StrategicMap[(AIRPORT2_X + (MAP_WORLD_X * AIRPORT2_Y))].fEnemyControlled )
|
||||
if ( !StrategicMap[CALCULATE_STRATEGIC_INDEX(AIRPORT_X, AIRPORT_Y)].fEnemyControlled && !StrategicMap[CALCULATE_STRATEGIC_INDEX(AIRPORT2_X, AIRPORT2_Y)].fEnemyControlled )
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "WillAirRaidBeStopped: enemy has no more airports" ) );
|
||||
return(TRUE);
|
||||
|
||||
@@ -2136,7 +2136,7 @@ void PlotPathForHelicopter( INT16 sX, INT16 sY )
|
||||
|
||||
// will plot a path from current position to sX, sY
|
||||
// get last sector in helicopters list, build new path, remove tail section, move to beginning of list, and append onto old list
|
||||
pVehicleList[ iHelicopterVehicleId ].pMercPath = AppendStrategicPath( MoveToBeginningOfPathList( BuildAStrategicPath( NULL, GetLastSectorOfHelicoptersPath( ), ( INT16 )( sX + sY*( MAP_WORLD_X ) ), pVehicleList[ iHelicopterVehicleId ].ubMovementGroup, FALSE /*, FALSE */ ) ), pVehicleList[ iHelicopterVehicleId ].pMercPath );
|
||||
pVehicleList[ iHelicopterVehicleId ].pMercPath = AppendStrategicPath( MoveToBeginningOfPathList( BuildAStrategicPath( NULL, GetLastSectorOfHelicoptersPath( ), ( INT16 )( CALCULATE_STRATEGIC_INDEX(sX, sY) ), pVehicleList[ iHelicopterVehicleId ].ubMovementGroup, FALSE /*, FALSE */ ) ), pVehicleList[ iHelicopterVehicleId ].pMercPath );
|
||||
|
||||
// move to beginning of list
|
||||
pVehicleList[ iHelicopterVehicleId ].pMercPath = MoveToBeginningOfPathList( pVehicleList[ iHelicopterVehicleId ].pMercPath );
|
||||
@@ -2220,7 +2220,7 @@ void PlotATemporaryPathForMilitia( INT16 sX, INT16 sY )
|
||||
return;
|
||||
|
||||
// build path
|
||||
pTempMilitiaPath = BuildAStrategicPath( NULL, GetLastSectorOfMilitiaPath( ), (INT16)(sX + sY*(MAP_WORLD_X)), gMilitiaPath[gMilitiaGroupId].sGroupid, TRUE /*, TRUE */ );
|
||||
pTempMilitiaPath = BuildAStrategicPath( NULL, GetLastSectorOfMilitiaPath( ), (INT16)( CALCULATE_STRATEGIC_INDEX(sX, sY )), gMilitiaPath[gMilitiaGroupId].sGroupid, TRUE /*, TRUE */ );
|
||||
}
|
||||
|
||||
|
||||
@@ -2333,10 +2333,8 @@ UINT32 ClearPathAfterThisSectorForMilitia( INT16 sX, INT16 sY )
|
||||
INT16 GetLastSectorOfHelicoptersPath( void )
|
||||
{
|
||||
// will return the last sector of the helicopter's current path
|
||||
INT16 sLastSector = pVehicleList[ iHelicopterVehicleId ].sSectorX + pVehicleList[ iHelicopterVehicleId ].sSectorY * MAP_WORLD_X ;
|
||||
PathStPtr pNode = NULL;
|
||||
|
||||
pNode = pVehicleList[ iHelicopterVehicleId ].pMercPath;
|
||||
INT16 sLastSector = CALCULATE_STRATEGIC_INDEX(pVehicleList[ iHelicopterVehicleId ].sSectorX, pVehicleList[ iHelicopterVehicleId ].sSectorY);
|
||||
PathStPtr pNode = pVehicleList[ iHelicopterVehicleId ].pMercPath;
|
||||
|
||||
while( pNode )
|
||||
{
|
||||
@@ -2351,9 +2349,7 @@ INT16 GetLastSectorOfMilitiaPath( void )
|
||||
{
|
||||
// will return the last sector of the helicopter's current path
|
||||
INT16 sLastSector = gMilitiaPlotStartSector;
|
||||
PathStPtr pNode = NULL;
|
||||
|
||||
pNode = gMilitiaPath[gMilitiaGroupId].path;
|
||||
PathStPtr pNode = gMilitiaPath[gMilitiaGroupId].path;
|
||||
|
||||
while ( pNode )
|
||||
{
|
||||
@@ -3966,7 +3962,9 @@ void ShowMilitiaInMotion( INT16 sX, INT16 sY )
|
||||
if ( !NumNonPlayerTeamMembersInSector( sX, sY, MILITIA_TEAM ) )
|
||||
return;
|
||||
|
||||
if ( ( StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags & MILITIA_MOVE_ALLDIRS ) == 0 )
|
||||
int sector = CALCULATE_STRATEGIC_INDEX( sX, sY );
|
||||
|
||||
if ( ( StrategicMap[sector].usFlags & MILITIA_MOVE_ALLDIRS ) == 0 )
|
||||
return;
|
||||
|
||||
// show the icons for people in motion from this sector to the next guy over
|
||||
@@ -3979,7 +3977,7 @@ void ShowMilitiaInMotion( INT16 sX, INT16 sY )
|
||||
INT16 iconOffsetX = 0;
|
||||
INT16 iconOffsetY = 0;
|
||||
|
||||
if ( StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags & MILITIA_MOVE_NORTH )
|
||||
if ( StrategicMap[sector].usFlags & MILITIA_MOVE_NORTH )
|
||||
{
|
||||
ubDirection = 4;
|
||||
sOffsetX = (MAP_GRID_X / 2);
|
||||
@@ -3987,21 +3985,21 @@ void ShowMilitiaInMotion( INT16 sX, INT16 sY )
|
||||
iconOffsetX = -(hIconHandle->pETRLEObject[ubDirection].usWidth / 2);
|
||||
iconOffsetY = -(hIconHandle->pETRLEObject[ubDirection].usHeight);
|
||||
}
|
||||
else if ( StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags & MILITIA_MOVE_EAST )
|
||||
else if ( StrategicMap[sector].usFlags & MILITIA_MOVE_EAST )
|
||||
{
|
||||
ubDirection = 5;
|
||||
sOffsetX = MAP_GRID_X;
|
||||
sOffsetY = (MAP_GRID_Y / 2);
|
||||
iconOffsetY = -(hIconHandle->pETRLEObject[ubDirection].usHeight / 2);
|
||||
}
|
||||
else if ( StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags & MILITIA_MOVE_SOUTH )
|
||||
else if ( StrategicMap[sector].usFlags & MILITIA_MOVE_SOUTH )
|
||||
{
|
||||
ubDirection = 6;
|
||||
sOffsetX = (MAP_GRID_X / 2);
|
||||
sOffsetY = MAP_GRID_Y;
|
||||
iconOffsetX = -(hIconHandle->pETRLEObject[ubDirection].usWidth / 2);
|
||||
}
|
||||
else if ( StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags & MILITIA_MOVE_WEST )
|
||||
else if ( StrategicMap[sector].usFlags & MILITIA_MOVE_WEST )
|
||||
{
|
||||
ubDirection = 7;
|
||||
sOffsetX = 0;
|
||||
|
||||
@@ -5866,7 +5866,7 @@ BOOLEAN NotifyPlayerWhenEnemyTakesControlOfImportantSector( INT16 sSectorX, INT1
|
||||
}
|
||||
|
||||
// get the strategic sector value
|
||||
sSector = sSectorX + MAP_WORLD_X * sSectorY;
|
||||
sSector = CALCULATE_STRATEGIC_INDEX(sSectorX, sSectorY);
|
||||
|
||||
if( StrategicMap[ sSector ].bNameId == BLANK_SECTOR )
|
||||
{
|
||||
@@ -5900,7 +5900,7 @@ void NotifyPlayerOfInvasionByEnemyForces( INT16 sSectorX, INT16 sSectorY, INT8 b
|
||||
}
|
||||
|
||||
// grab sector value
|
||||
sSector = sSectorX + MAP_WORLD_X * sSectorY;
|
||||
sSector = CALCULATE_STRATEGIC_INDEX( sSectorX, sSectorY );
|
||||
|
||||
if( StrategicMap[ sSector ].fEnemyControlled == TRUE )
|
||||
{
|
||||
|
||||
@@ -1332,7 +1332,7 @@ void HandleFirstBattleEndingWhileInTown( INT16 sSectorX, INT16 sSectorY, INT16 b
|
||||
// means player is leaving sector
|
||||
|
||||
// grab sector value
|
||||
sSector = sSectorX + sSectorY * MAP_WORLD_X;
|
||||
sSector = CALCULATE_STRATEGIC_INDEX( sSectorX, sSectorY );
|
||||
|
||||
// get town name id
|
||||
bTownId = StrategicMap[ sSector ].bNameId;
|
||||
|
||||
@@ -1209,7 +1209,7 @@ void NotifyPlayerOfMercDepartureAndPromptEquipmentPlacement( SOLDIERTYPE *pSoldi
|
||||
fInSector = TRUE;
|
||||
}
|
||||
// check if drassen controlled
|
||||
else if( StrategicMap[ ( AIRPORT_X + ( MAP_WORLD_X * AIRPORT_Y ) ) ].fEnemyControlled == FALSE )
|
||||
else if( StrategicMap[CALCULATE_STRATEGIC_INDEX( AIRPORT_X, AIRPORT_Y )].fEnemyControlled == FALSE )
|
||||
{
|
||||
GetSectorIDString( AIRPORT_X, AIRPORT_Y, 0, zDropOffString, FALSE );
|
||||
|
||||
@@ -1348,7 +1348,7 @@ void MercDepartEquipmentBoxCallBack( UINT8 bExitValue )
|
||||
else
|
||||
{
|
||||
// no
|
||||
if( StrategicMap[ AIRPORT_X + ( AIRPORT_Y * MAP_WORLD_X ) ].fEnemyControlled == FALSE )
|
||||
if( StrategicMap[CALCULATE_STRATEGIC_INDEX( AIRPORT_X, AIRPORT_Y )].fEnemyControlled == FALSE )
|
||||
{
|
||||
HandleMercLeavingEquipmentInDrassen( pLeaveSoldier->ubID );
|
||||
}
|
||||
|
||||
@@ -1053,11 +1053,13 @@ void MilitiaMovementOrder(UINT8 sector)
|
||||
INT16 sX = SECTORX(sector);
|
||||
INT16 sY = SECTORY(sector);
|
||||
|
||||
int strategicsector = CALCULATE_STRATEGIC_INDEX( sX, sY );
|
||||
|
||||
// if we are in gamescreen and a battle is going on, and this is the sector that militia moves from, don't move them. Suddenly disappearing would be... awkward
|
||||
if ( guiCurrentScreen == GAME_SCREEN && gTacticalStatus.uiFlags & INCOMBAT && gWorldSectorX == sX && gWorldSectorY == sY && !gbWorldSectorZ )
|
||||
{
|
||||
// remove all movement flags
|
||||
StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags &= ~MILITIA_MOVE_ALLDIRS;
|
||||
StrategicMap[strategicsector].usFlags &= ~MILITIA_MOVE_ALLDIRS;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1067,24 +1069,24 @@ void MilitiaMovementOrder(UINT8 sector)
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, gpStrategicString[STR_MILITIAMOVEMENT_NO_STAFF_ABORT] );
|
||||
|
||||
// remove all movement flags
|
||||
StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags &= ~MILITIA_MOVE_ALLDIRS;
|
||||
StrategicMap[strategicsector].usFlags &= ~MILITIA_MOVE_ALLDIRS;
|
||||
return;
|
||||
}
|
||||
|
||||
INT16 targetX = sX;
|
||||
INT16 targetY = sY;
|
||||
|
||||
if ( StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags & MILITIA_MOVE_NORTH )
|
||||
if ( StrategicMap[strategicsector].usFlags & MILITIA_MOVE_NORTH )
|
||||
--targetY;
|
||||
else if ( StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags & MILITIA_MOVE_WEST )
|
||||
else if ( StrategicMap[strategicsector].usFlags & MILITIA_MOVE_WEST )
|
||||
--targetX;
|
||||
else if ( StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags & MILITIA_MOVE_EAST )
|
||||
else if ( StrategicMap[strategicsector].usFlags & MILITIA_MOVE_EAST )
|
||||
++targetX;
|
||||
else if ( StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags & MILITIA_MOVE_SOUTH )
|
||||
else if ( StrategicMap[strategicsector].usFlags & MILITIA_MOVE_SOUTH )
|
||||
++targetY;
|
||||
|
||||
// remove all movement flags
|
||||
StrategicMap[ sX + ( sY * MAP_WORLD_X ) ].usFlags &= ~MILITIA_MOVE_ALLDIRS;
|
||||
StrategicMap[strategicsector].usFlags &= ~MILITIA_MOVE_ALLDIRS;
|
||||
|
||||
UINT8 targetsector = SECTOR(targetX, targetY);
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
|
||||
|
||||
if( bMapZ == 0 )
|
||||
{
|
||||
usMapSector = sMapX + ( sMapY * MAP_WORLD_X );
|
||||
usMapSector = CALCULATE_STRATEGIC_INDEX(sMapX, sMapY);
|
||||
|
||||
/*
|
||||
// if enemies formerly controlled this sector
|
||||
@@ -465,7 +465,7 @@ BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BO
|
||||
|
||||
if( bMapZ == 0 )
|
||||
{
|
||||
usMapSector = sMapX + ( sMapY * MAP_WORLD_X );
|
||||
usMapSector = CALCULATE_STRATEGIC_INDEX(sMapX, sMapY);
|
||||
|
||||
fWasPlayerControlled = !StrategicMap[ usMapSector ].fEnemyControlled;
|
||||
|
||||
@@ -586,7 +586,7 @@ void ClearMapControlledFlags( void )
|
||||
{
|
||||
for( iCounterB = 1; iCounterB < MAP_WORLD_Y - 1; iCounterB++ )
|
||||
{
|
||||
usMapSector = iCounterA + ( iCounterB * MAP_WORLD_X );
|
||||
usMapSector = CALCULATE_STRATEGIC_INDEX(iCounterA, iCounterB);
|
||||
StrategicMap[ usMapSector ].fEnemyControlled = FALSE;
|
||||
SectorInfo[ SECTOR( iCounterA, iCounterB ) ].fPlayer[ 0 ] = TRUE;
|
||||
}
|
||||
|
||||
@@ -1233,31 +1233,31 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
|
||||
gubFact[usFact] = SpokenToHeadMiner( MINE_DRASSEN );
|
||||
break;
|
||||
case FACT_PLAYER_IN_CONTROLLED_DRASSEN_MINE:
|
||||
gubFact[usFact] = ( GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) == MINE_DRASSEN && !(StrategicMap[ gWorldSectorX + MAP_WORLD_X * gWorldSectorY ].fEnemyControlled) );
|
||||
gubFact[usFact] = ( GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) == MINE_DRASSEN && !(StrategicMap[CALCULATE_STRATEGIC_INDEX(gWorldSectorX, gWorldSectorY)].fEnemyControlled) );
|
||||
break;
|
||||
case FACT_PLAYER_SPOKE_TO_CAMBRIA_MINER:
|
||||
gubFact[usFact] = SpokenToHeadMiner( MINE_CAMBRIA );
|
||||
break;
|
||||
case FACT_PLAYER_IN_CONTROLLED_CAMBRIA_MINE:
|
||||
gubFact[usFact] = ( GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) == MINE_CAMBRIA && !(StrategicMap[ gWorldSectorX + MAP_WORLD_X * gWorldSectorY ].fEnemyControlled) );
|
||||
gubFact[usFact] = ( GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) == MINE_CAMBRIA && !(StrategicMap[CALCULATE_STRATEGIC_INDEX( gWorldSectorX, gWorldSectorY )].fEnemyControlled) );
|
||||
break;
|
||||
case FACT_PLAYER_SPOKE_TO_CHITZENA_MINER:
|
||||
gubFact[usFact] = SpokenToHeadMiner( MINE_CHITZENA );
|
||||
break;
|
||||
case FACT_PLAYER_IN_CONTROLLED_CHITZENA_MINE:
|
||||
gubFact[usFact] = ( GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) == MINE_CHITZENA && !(StrategicMap[ gWorldSectorX + MAP_WORLD_X * gWorldSectorY ].fEnemyControlled) );
|
||||
gubFact[usFact] = ( GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) == MINE_CHITZENA && !(StrategicMap[CALCULATE_STRATEGIC_INDEX( gWorldSectorX, gWorldSectorY )].fEnemyControlled) );
|
||||
break;
|
||||
case FACT_PLAYER_SPOKE_TO_ALMA_MINER:
|
||||
gubFact[usFact] = SpokenToHeadMiner( MINE_ALMA );
|
||||
break;
|
||||
case FACT_PLAYER_IN_CONTROLLED_ALMA_MINE:
|
||||
gubFact[usFact] = ( GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) == MINE_ALMA && !(StrategicMap[ gWorldSectorX + MAP_WORLD_X * gWorldSectorY ].fEnemyControlled) );
|
||||
gubFact[usFact] = ( GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) == MINE_ALMA && !(StrategicMap[CALCULATE_STRATEGIC_INDEX( gWorldSectorX, gWorldSectorY )].fEnemyControlled) );
|
||||
break;
|
||||
case FACT_PLAYER_SPOKE_TO_GRUMM_MINER:
|
||||
gubFact[usFact] = SpokenToHeadMiner( MINE_GRUMM );
|
||||
break;
|
||||
case FACT_PLAYER_IN_CONTROLLED_GRUMM_MINE:
|
||||
gubFact[usFact] = ( GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) == MINE_GRUMM && !(StrategicMap[ gWorldSectorX + MAP_WORLD_X * gWorldSectorY ].fEnemyControlled) );
|
||||
gubFact[usFact] = ( GetIdOfMineForSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) == MINE_GRUMM && !(StrategicMap[CALCULATE_STRATEGIC_INDEX( gWorldSectorX, gWorldSectorY )].fEnemyControlled) );
|
||||
break;
|
||||
|
||||
case FACT_ENOUGH_LOYALTY_TO_TRAIN_MILITIA:
|
||||
|
||||
@@ -2253,9 +2253,10 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic5");
|
||||
|
||||
if( IsThisSectorASAMSector( pGroup->ubSectorX, pGroup->ubSectorY, 0 ) )
|
||||
{
|
||||
StrategicMap[ pGroup->ubSectorX + pGroup->ubSectorY * MAP_WORLD_X ].bSAMCondition = 100;
|
||||
StrategicMap[ pGroup->ubSectorX + pGroup->ubSectorY * MAP_WORLD_X ].sSamHackStatus = 100;
|
||||
StrategicMap[ pGroup->ubSectorX + pGroup->ubSectorY * MAP_WORLD_X ].usFlags &= ~SAMSITE_REPAIR_ORDERED;
|
||||
int stratsector = CALCULATE_STRATEGIC_INDEX( pGroup->ubSectorX, pGroup->ubSectorY );
|
||||
StrategicMap[stratsector].bSAMCondition = 100;
|
||||
StrategicMap[stratsector].sSamHackStatus = 100;
|
||||
StrategicMap[stratsector].usFlags &= ~SAMSITE_REPAIR_ORDERED;
|
||||
|
||||
UpdateSAMDoneRepair( pGroup->ubSectorX, pGroup->ubSectorY, 0 );
|
||||
}
|
||||
@@ -5918,7 +5919,7 @@ void StrategicHandleQueenLosingControlOfSector( INT16 sSectorX, INT16 sSectorY,
|
||||
|
||||
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
|
||||
|
||||
if( StrategicMap[ sSectorX + sSectorY * MAP_WORLD_X ].fEnemyControlled )
|
||||
if( StrategicMap[CALCULATE_STRATEGIC_INDEX(sSectorX, sSectorY)].fEnemyControlled )
|
||||
{
|
||||
//If the sector doesn't belong to the player, then we shouldn't be calling this function!
|
||||
SAIReportError( L"StrategicHandleQueenLosingControlOfSector() was called for a sector that is internally considered to be enemy controlled." );
|
||||
|
||||
@@ -857,7 +857,7 @@ INT16 GetMineSectorForTown( INT8 bTownId )
|
||||
if( gMineStatus[ ubMineIndex ].bAssociatedTown == bTownId )
|
||||
{
|
||||
//sMineSector = gMineLocation[ ubMineIndex ].sSectorX + ( gMineLocation[ ubMineIndex ].sSectorY * MAP_WORLD_X );
|
||||
sMineSector = gMineStatus[ ubMineIndex ].sSectorX + ( gMineStatus[ ubMineIndex ].sSectorY * MAP_WORLD_X );
|
||||
sMineSector = CALCULATE_STRATEGIC_INDEX(gMineStatus[ ubMineIndex ].sSectorX, gMineStatus[ ubMineIndex ].sSectorY );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -888,7 +888,7 @@ BOOLEAN PlayerControlsMine(INT8 bMineIndex)
|
||||
{
|
||||
// a value of TRUE is from the enemy's point of view
|
||||
//if (StrategicMap[( gMineLocation[ bMineIndex ].sSectorX ) + ( MAP_WORLD_X * ( gMineLocation[ bMineIndex ].sSectorY ) )].fEnemyControlled == TRUE )
|
||||
if (StrategicMap[( gMineStatus[ bMineIndex ].sSectorX ) + ( MAP_WORLD_X * ( gMineStatus[ bMineIndex ].sSectorY ) )].fEnemyControlled == TRUE )
|
||||
if (StrategicMap[CALCULATE_STRATEGIC_INDEX( gMineStatus[bMineIndex].sSectorX, gMineStatus[bMineIndex].sSectorY )].fEnemyControlled == TRUE )
|
||||
return(FALSE);
|
||||
else
|
||||
{
|
||||
|
||||
@@ -5691,7 +5691,7 @@ BOOLEAN HandlePlayerGroupEnteringSectorToCheckForNPCsOfNote( GROUP *pGroup )
|
||||
}
|
||||
|
||||
// get the strategic sector value
|
||||
sStrategicSector = sSectorX + MAP_WORLD_X * sSectorY;
|
||||
sStrategicSector = CALCULATE_STRATEGIC_INDEX(sSectorX, sSectorY);
|
||||
#ifdef JA2UB
|
||||
// ATE: if this is a custom map, return Ja25 UB
|
||||
if ( SectorInfo[ SECTOR( sSectorY, sSectorX ) ].fCustomSector )
|
||||
|
||||
@@ -920,7 +920,7 @@ PathStPtr ClearStrategicPathListAfterThisSector( PathStPtr pHeadOfPath, INT16 sX
|
||||
}
|
||||
|
||||
// get sector value
|
||||
sSector = sX + ( sY * MAP_WORLD_X );
|
||||
sSector = CALCULATE_STRATEGIC_INDEX(sX, sY );
|
||||
|
||||
// go to end of list
|
||||
pNode = MoveToEndOfPathList( pNode );
|
||||
@@ -1016,7 +1016,7 @@ PathStPtr ClearStrategicPathListBeforeThisSector( PathStPtr pHeadOfPath, INT16 s
|
||||
}
|
||||
|
||||
// get sector value
|
||||
sSector = sX + ( sY * MAP_WORLD_X );
|
||||
sSector = CALCULATE_STRATEGIC_INDEX(sX, sY);
|
||||
|
||||
// go to end of list
|
||||
pNode = MoveToBeginningOfPathList( pNode );
|
||||
@@ -1219,7 +1219,7 @@ PathStPtr RemoveSectorFromStrategicPathList( PathStPtr pList , INT16 sX, INT16 s
|
||||
PathStPtr pPastNode = pList;
|
||||
|
||||
// get sector value
|
||||
sSector = sX + ( sY * MAP_WORLD_X );
|
||||
sSector = CALCULATE_STRATEGIC_INDEX( sX, sY );
|
||||
|
||||
// check if there is a valid list
|
||||
if( pNode == NULL )
|
||||
@@ -1270,10 +1270,8 @@ PathStPtr RemoveSectorFromStrategicPathList( PathStPtr pList , INT16 sX, INT16 s
|
||||
INT16 GetLastSectorIdInCharactersPath( SOLDIERTYPE *pCharacter )
|
||||
{
|
||||
// will return the last sector of the current path, or the current sector if there's no path
|
||||
INT16 sLastSector = ( pCharacter->sSectorX ) + ( pCharacter->sSectorY ) * ( MAP_WORLD_X );
|
||||
PathStPtr pNode = NULL;
|
||||
|
||||
pNode = GetSoldierMercPathPtr( pCharacter );
|
||||
INT16 sLastSector = CALCULATE_STRATEGIC_INDEX( pCharacter->sSectorX, pCharacter->sSectorY );
|
||||
PathStPtr pNode = GetSoldierMercPathPtr( pCharacter );
|
||||
|
||||
while( pNode )
|
||||
{
|
||||
@@ -1301,7 +1299,7 @@ INT16 GetLastSectorIdInVehiclePath( INT32 iId )
|
||||
}
|
||||
|
||||
// get current last sector
|
||||
sLastSector = ( pVehicleList[ iId ].sSectorX ) + ( pVehicleList[ iId ].sSectorY * MAP_WORLD_X );
|
||||
sLastSector = CALCULATE_STRATEGIC_INDEX( pVehicleList[ iId ].sSectorX, pVehicleList[ iId ].sSectorY );
|
||||
|
||||
pNode = pVehicleList[ iId ].pMercPath;
|
||||
|
||||
|
||||
@@ -911,7 +911,7 @@ void HandleMurderOfCivilian( SOLDIERTYPE *pSoldier, BOOLEAN fIntentional )
|
||||
iLoyaltyChange *= MULTIPLIER_FOR_MURDER_BY_MONSTER;
|
||||
|
||||
// check whose sector this is
|
||||
if( StrategicMap[( pSoldier->sSectorX ) + ( MAP_WORLD_X * ( pSoldier->sSectorY ) )].fEnemyControlled == TRUE )
|
||||
if( StrategicMap[CALCULATE_STRATEGIC_INDEX( pSoldier->sSectorX, pSoldier->sSectorY )].fEnemyControlled == TRUE )
|
||||
{
|
||||
// enemy controlled sector - gain loyalty
|
||||
fIncrement = TRUE;
|
||||
@@ -1084,7 +1084,7 @@ void HandleLoyaltyForDemolitionOfBuilding( SOLDIERTYPE *pSoldier, INT16 sPointsD
|
||||
|
||||
|
||||
// penalize the side that should have stopped it
|
||||
if( StrategicMap[ pSoldier->sSectorX + pSoldier->sSectorY * MAP_WORLD_X ].fEnemyControlled == TRUE )
|
||||
if( StrategicMap[CALCULATE_STRATEGIC_INDEX( pSoldier->sSectorX, pSoldier->sSectorY )].fEnemyControlled == TRUE )
|
||||
{
|
||||
// enemy should have prevented it, let them suffer a little
|
||||
IncrementTownLoyalty( bTownId, sPolicingLoyalty );
|
||||
@@ -1243,7 +1243,7 @@ void BuildListOfTownSectors( void )
|
||||
{
|
||||
for( iCounterY = 0; iCounterY < MAP_WORLD_Y; iCounterY++ )
|
||||
{
|
||||
usSector = iCounterX + iCounterY * MAP_WORLD_X;
|
||||
usSector = CALCULATE_STRATEGIC_INDEX( iCounterX, iCounterY );
|
||||
|
||||
if( ( StrategicMap[ usSector ].bNameId >= FIRST_TOWN ) && ( StrategicMap[ usSector ].bNameId < NUM_TOWNS ) )
|
||||
{
|
||||
@@ -1745,7 +1745,7 @@ void AffectAllTownsLoyaltyByDistanceFrom( INT32 iLoyaltyChange, INT16 sSectorX,
|
||||
iShortestDistance[ bTownId ] = 999999;
|
||||
}
|
||||
|
||||
sEventSector = sSectorX + ( MAP_WORLD_X * sSectorY );
|
||||
sEventSector = CALCULATE_STRATEGIC_INDEX( sSectorX, sSectorY );
|
||||
|
||||
// need a temporary group create to use for laying down distance paths
|
||||
ubTempGroupId = CreateNewPlayerGroupDepartingFromSector( (UINT8) sSectorX, (UINT8) sSectorY );
|
||||
@@ -1861,7 +1861,7 @@ void AffectClosestTownLoyaltyByDistanceFrom( INT32 iLoyaltyChange, INT16 sSector
|
||||
iShortestDistance[bTownId] = 999999;
|
||||
}
|
||||
|
||||
sEventSector = sSectorX + ( MAP_WORLD_X * sSectorY );
|
||||
sEventSector = CALCULATE_STRATEGIC_INDEX( sSectorX, sSectorY );
|
||||
|
||||
// need a temporary group create to use for laying down distance paths
|
||||
ubTempGroupId = CreateNewPlayerGroupDepartingFromSector( (UINT8)sSectorX, (UINT8)sSectorY );
|
||||
|
||||
@@ -117,7 +117,7 @@ void VerifyTownTrainingIsPaidFor( void );
|
||||
BOOLEAN TownMilitiaTrainingPromotion( INT16 sMapX, INT16 sMapY, UINT8& arusPromotedTo )
|
||||
{
|
||||
INT16 sNeighbourX, sNeighbourY;
|
||||
UINT8 ubTownId = StrategicMap[sMapX + sMapY * MAP_WORLD_X].bNameId;
|
||||
UINT8 ubTownId = StrategicMap[CALCULATE_STRATEGIC_INDEX( sMapX, sMapY )].bNameId;
|
||||
|
||||
// alrighty, then. We'll have to *promote* guys instead.
|
||||
|
||||
@@ -274,7 +274,7 @@ void TownMilitiaTrainingCompleted( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMa
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia1");
|
||||
|
||||
// get town index
|
||||
ubTownId = StrategicMap[ sMapX + sMapY * MAP_WORLD_X ].bNameId;
|
||||
ubTownId = StrategicMap[CALCULATE_STRATEGIC_INDEX( sMapX, sMapY )].bNameId;
|
||||
|
||||
if( ubTownId == BLANK_SECTOR )
|
||||
{
|
||||
@@ -752,7 +752,7 @@ BOOLEAN SectorOursAndPeaceful( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
}
|
||||
|
||||
// if sector is controlled by enemies, it's not ours (duh!)
|
||||
if( !bMapZ && StrategicMap[ sMapX + sMapY * MAP_WORLD_X ].fEnemyControlled == TRUE )
|
||||
if( !bMapZ && StrategicMap[CALCULATE_STRATEGIC_INDEX( sMapX, sMapY )].fEnemyControlled == TRUE )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1143,7 +1143,7 @@ BOOLEAN CanSomeoneNearbyScoutThisSector( INT16 sSectorX, INT16 sSectorY, BOOLEAN
|
||||
return TRUE;
|
||||
|
||||
// get the sector value
|
||||
sSector = sSectorX + sSectorY * MAP_WORLD_X;
|
||||
sSector = CALCULATE_STRATEGIC_INDEX( sSectorX, sSectorY );
|
||||
|
||||
for( sCounterA = sSectorX - ubScoutingRange; (sCounterA <= sSectorX + ubScoutingRange && !bScout); ++sCounterA )
|
||||
{
|
||||
@@ -1425,7 +1425,7 @@ void AddSectorForSoldierToListOfSectorsThatCompletedMilitiaTraining( SOLDIERTYPE
|
||||
pCurrentSoldier = &Menptr[ giListOfMercsInSectorsCompletedMilitiaTraining[ iCounter ] ];
|
||||
|
||||
// get the current sector value
|
||||
sCurrentSector = pCurrentSoldier->sSectorX + pCurrentSoldier->sSectorY * MAP_WORLD_X;
|
||||
sCurrentSector = CALCULATE_STRATEGIC_INDEX( pCurrentSoldier->sSectorX, pCurrentSoldier->sSectorY );
|
||||
|
||||
// is the merc's sector already in the list?
|
||||
// silversurfer: Doesn't matter if it's the same sector. We can have different assignments in the same sector so add the soldier to the list if he's on a different assignment.
|
||||
|
||||
@@ -6517,7 +6517,7 @@ UINT32 HandleMapUI( )
|
||||
break;
|
||||
|
||||
// check if last sector in character's path is same as where mouse is
|
||||
if( GetLastSectorIdInCharactersPath( &Menptr[gCharactersList[GetSelectedDestChar()].usSolID] ) != ( sMapX + ( sMapY * MAP_WORLD_X ) ) )
|
||||
if( GetLastSectorIdInCharactersPath( &Menptr[gCharactersList[GetSelectedDestChar()].usSolID] ) != CALCULATE_STRATEGIC_INDEX( sMapX, sMapY ) )
|
||||
{
|
||||
sX = ( GetLastSectorIdInCharactersPath( &Menptr[gCharactersList[GetSelectedDestChar()].usSolID] ) % MAP_WORLD_X );
|
||||
sY = ( GetLastSectorIdInCharactersPath( &Menptr[gCharactersList[GetSelectedDestChar()].usSolID] ) / MAP_WORLD_X );
|
||||
@@ -12490,7 +12490,7 @@ BOOLEAN CheckIfClickOnLastSectorInPath( INT16 sX, INT16 sY )
|
||||
if( fPlotForHelicopter )
|
||||
{
|
||||
// helicopter route confirmed
|
||||
if( sX + ( sY * MAP_WORLD_X ) == GetLastSectorOfHelicoptersPath( ) )
|
||||
if ( CALCULATE_STRATEGIC_INDEX( sX, sY ) == GetLastSectorOfHelicoptersPath( ) )
|
||||
{
|
||||
// WANNE: This check was added in revision 4724, to prevent the loophole for helicopter hovering forever
|
||||
// But is seems, it also causes the bug, that skyrider is stuck in the sector forever (bugzilla #562)
|
||||
@@ -12515,7 +12515,7 @@ BOOLEAN CheckIfClickOnLastSectorInPath( INT16 sX, INT16 sY )
|
||||
else if ( fPlotForMilitia )
|
||||
{
|
||||
// helicopter route confirmed
|
||||
if ( gMilitiaPath[gMilitiaGroupId].sGroupid > -1 && sX + (sY * MAP_WORLD_X) == GetLastSectorOfMilitiaPath( ) )
|
||||
if ( gMilitiaPath[gMilitiaGroupId].sGroupid > -1 && CALCULATE_STRATEGIC_INDEX(sX, sY) == GetLastSectorOfMilitiaPath( ) )
|
||||
{
|
||||
// rebuild waypoints
|
||||
ppMovePath = &( gMilitiaPath[gMilitiaGroupId].path );
|
||||
@@ -12552,7 +12552,7 @@ BOOLEAN CheckIfClickOnLastSectorInPath( INT16 sX, INT16 sY )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if( sX + ( sY * MAP_WORLD_X ) == GetLastSectorIdInCharactersPath( ( &Menptr[ gCharactersList[GetSelectedDestChar()].usSolID ] ) ) )
|
||||
if ( CALCULATE_STRATEGIC_INDEX( sX, sY ) == GetLastSectorIdInCharactersPath( ( &Menptr[ gCharactersList[GetSelectedDestChar()].usSolID ] ) ) )
|
||||
{
|
||||
// clicked on last sector, reset plotting mode
|
||||
|
||||
@@ -12697,7 +12697,7 @@ void UpdateCursorIfInLastSector( void )
|
||||
// check for helicopter
|
||||
if ( fPlotForHelicopter )
|
||||
{
|
||||
if ( sMapX + (sMapY * MAP_WORLD_X) == GetLastSectorOfHelicoptersPath( ) )
|
||||
if ( CALCULATE_STRATEGIC_INDEX( sMapX, sMapY ) == GetLastSectorOfHelicoptersPath( ) )
|
||||
{
|
||||
// set cursor to checkmark
|
||||
ChangeMapScreenMaskCursor( CURSOR_CHECKMARK );
|
||||
@@ -12719,7 +12719,7 @@ void UpdateCursorIfInLastSector( void )
|
||||
// check for militia
|
||||
if ( fPlotForMilitia )
|
||||
{
|
||||
if ( sMapX + (sMapY * MAP_WORLD_X) == GetLastSectorOfMilitiaPath( ) )
|
||||
if ( CALCULATE_STRATEGIC_INDEX( sMapX, sMapY ) == GetLastSectorOfMilitiaPath( ) )
|
||||
{
|
||||
// set cursor to checkmark
|
||||
ChangeMapScreenMaskCursor( CURSOR_CHECKMARK );
|
||||
@@ -12741,7 +12741,7 @@ void UpdateCursorIfInLastSector( void )
|
||||
if ( GetSelectedDestChar() != -1 )
|
||||
{
|
||||
//c heck if we are in the last sector of the characters path?
|
||||
if ( sMapX + (sMapY * MAP_WORLD_X) == GetLastSectorIdInCharactersPath( (&Menptr[gCharactersList[GetSelectedDestChar()].usSolID]) ) )
|
||||
if ( CALCULATE_STRATEGIC_INDEX( sMapX, sMapY ) == GetLastSectorIdInCharactersPath( (&Menptr[gCharactersList[GetSelectedDestChar()].usSolID]) ) )
|
||||
{
|
||||
// set cursor to checkmark
|
||||
ChangeMapScreenMaskCursor( CURSOR_CHECKMARK );
|
||||
@@ -16615,7 +16615,7 @@ BOOLEAN RequestGiveMilitiaNewDestination( void )
|
||||
gNewMilitiaGroupId = gMilitiaPath[gMilitiaGroupId].sGroupid;
|
||||
|
||||
// yes, we intentionally use a different sector number here
|
||||
gMilitiaPlotStartSector = (INT16)(sSelMapX + sSelMapY*(MAP_WORLD_X));
|
||||
gMilitiaPlotStartSector = CALCULATE_STRATEGIC_INDEX( sSelMapX, sSelMapY );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16753,7 +16753,7 @@ BOOLEAN MilitiaPlotStart( )
|
||||
gNewMilitiaGroupId = pGroup->ubGroupID;
|
||||
|
||||
// yes, we intentionally use a different sector number here
|
||||
gMilitiaPlotStartSector = (INT16)(sSelMapX + sSelMapY*(MAP_WORLD_X));
|
||||
gMilitiaPlotStartSector = CALCULATE_STRATEGIC_INDEX( sSelMapX, sSelMapY );
|
||||
|
||||
gMilitiaPath[gMilitiaGroupId].path->uiSectorId = gMilitiaPlotStartSector;
|
||||
|
||||
|
||||
@@ -1972,8 +1972,8 @@ void InitializeSAMSites( void )
|
||||
// all SAM sites start game in perfect working condition
|
||||
for ( UINT32 cnt = 0; cnt < NUMBER_OF_SAMS; ++cnt )
|
||||
{
|
||||
StrategicMap[gpSamSectorX[cnt] + (MAP_WORLD_X * gpSamSectorY[cnt])].bSAMCondition = 100;
|
||||
StrategicMap[gpSamSectorX[cnt] + (MAP_WORLD_X * gpSamSectorY[cnt])].sSamHackStatus = 100;
|
||||
StrategicMap[CALCULATE_STRATEGIC_INDEX( gpSamSectorX[cnt], gpSamSectorY[cnt] )].bSAMCondition = 100;
|
||||
StrategicMap[CALCULATE_STRATEGIC_INDEX( gpSamSectorX[cnt], gpSamSectorY[cnt] )].sSamHackStatus = 100;
|
||||
}
|
||||
|
||||
// Flugente, bizarrely enough, this structure is not NULLED when starting a new campaign. For now, we NULL the flagmask to clear at least that
|
||||
@@ -5560,7 +5560,7 @@ BOOLEAN LoadStrategicInfoFromSavedFile( HWFILE hFile )
|
||||
// all SAM sites start game in perfect working condition
|
||||
for ( UINT32 cnt = 0; cnt < NUMBER_OF_SAMS; ++cnt )
|
||||
{
|
||||
StrategicMap[gpSamSectorX[cnt] + (MAP_WORLD_X * gpSamSectorY[cnt])].sSamHackStatus = 100;
|
||||
StrategicMap[CALCULATE_STRATEGIC_INDEX( gpSamSectorX[cnt], gpSamSectorY[cnt] )].sSamHackStatus = 100;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -842,7 +842,7 @@ void CheckForValidArrivalSector( )
|
||||
CHAR16 zShortTownIDString1[ 50 ];
|
||||
CHAR16 zShortTownIDString2[ 50 ];
|
||||
|
||||
sSectorGridNo = gsMercArriveSectorX + ( MAP_WORLD_X * gsMercArriveSectorY );
|
||||
sSectorGridNo = CALCULATE_STRATEGIC_INDEX( gsMercArriveSectorX, gsMercArriveSectorY );
|
||||
|
||||
// Check if valid...
|
||||
if ( !StrategicMap[ sSectorGridNo ].fEnemyControlled )
|
||||
|
||||
@@ -6844,7 +6844,7 @@ BOOLEAN GetPlayerControlledPrisonList( std::vector<UINT8>& arSectorIDVector )
|
||||
for(INT16 sY = 1; sY < MAP_WORLD_Y - 1; ++sY )
|
||||
{
|
||||
// if sector is controlled by enemies, it's not ours (duh!)
|
||||
if ( StrategicMap[sX + sY * MAP_WORLD_X].fEnemyControlled )
|
||||
if ( StrategicMap[CALCULATE_STRATEGIC_INDEX(sX, sY)].fEnemyControlled )
|
||||
continue;
|
||||
|
||||
// only sectors where there are no ongoing battles or even enemy garrisons are valid for our cause
|
||||
|
||||
@@ -749,7 +749,7 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
|
||||
{
|
||||
// Tixa prison, once liberated, should not have any civs without profiles unless
|
||||
// they are kids
|
||||
if( !StrategicMap[ TIXA_SECTOR_X + TIXA_SECTOR_Y * MAP_WORLD_X ].fEnemyControlled && tempDetailedPlacement.ubProfile == NO_PROFILE && tempDetailedPlacement.ubBodyType != HATKIDCIV && tempDetailedPlacement.ubBodyType != KIDCIV )
|
||||
if( !StrategicMap[CALCULATE_STRATEGIC_INDEX(TIXA_SECTOR_X, TIXA_SECTOR_Y)].fEnemyControlled && tempDetailedPlacement.ubProfile == NO_PROFILE && tempDetailedPlacement.ubBodyType != HATKIDCIV && tempDetailedPlacement.ubBodyType != KIDCIV )
|
||||
{
|
||||
// not there
|
||||
return( TRUE );
|
||||
|
||||
Reference in New Issue
Block a user