diff --git a/Init.cpp b/Init.cpp index 8ef9e3db..06249651 100644 --- a/Init.cpp +++ b/Init.cpp @@ -369,11 +369,6 @@ BOOLEAN LoadExternalGameplayData(STR directoryName) return FALSE; // Lesh: army externalization - strcpy(fileName, directoryName); - strcat(fileName, COMPOSITIONFILENAME); - if ( !ReadInPatrolInfo(fileName) ) - return FALSE; - strcpy(fileName, directoryName); strcat(fileName, GARRISONFILENAME); if ( !ReadInGarrisonInfo(fileName) ) diff --git a/Strategic/Map Screen Helicopter.cpp b/Strategic/Map Screen Helicopter.cpp index f1a724e2..697a65f4 100644 --- a/Strategic/Map Screen Helicopter.cpp +++ b/Strategic/Map Screen Helicopter.cpp @@ -54,7 +54,7 @@ extern UINT8 gubCurrentTalkingID; // current temp path for dest char extern PathStPtr pTempHelicopterPath; -extern UINT8 ubSAMControlledSectors[ MAP_WORLD_X ][ MAP_WORLD_Y ]; +extern UINT8 ubSAMControlledSectors[ MAP_WORLD_Y ][ MAP_WORLD_X ]; // the seating capacities extern INT32 iSeatingCapacities[]; @@ -1709,7 +1709,7 @@ BOOLEAN WillAirRaidBeStopped( INT16 sSectorX, INT16 sSectorY ) // which SAM controls this sector? - ubSamNumber = ubSAMControlledSectors[ sSectorX ][ sSectorY ]; + ubSamNumber = ubSAMControlledSectors[ sSectorY ][ sSectorX ]; DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("WillAirRaidBeStopped: SAM number = %d",ubSamNumber)); // if none of them @@ -1772,7 +1772,7 @@ BOOLEAN HandleSAMSiteAttackOfHelicopterInSector( INT16 sSectorX, INT16 sSectorY } // which SAM controls this sector? - ubSamNumber = ubSAMControlledSectors[ sSectorX ][ sSectorY ]; + ubSamNumber = ubSAMControlledSectors[ sSectorY ][ sSectorX ]; // if none of them if (ubSamNumber == 0) diff --git a/Strategic/Map Screen Interface Map.cpp b/Strategic/Map Screen Interface Map.cpp index 3ef87b61..2da8651e 100644 --- a/Strategic/Map Screen Interface Map.cpp +++ b/Strategic/Map Screen Interface Map.cpp @@ -6664,7 +6664,7 @@ void ShowSAMSitesOnStrategicMap( void ) BlitSAMGridMarkers( ); } - for( iCounter = 0; iCounter < NUMBER_OF_SAM_SITES; iCounter++ ) + for( iCounter = 0; iCounter < NUMBER_OF_SAMS; iCounter++ ) { // has the sam site here been found? if( !fSamSiteFound[ iCounter ] ) @@ -6770,7 +6770,7 @@ void BlitSAMGridMarkers( void ) // clip to view region ClipBlitsToMapViewRegionForRectangleAndABit( uiDestPitchBYTES ); - for( iCounter = 0; iCounter < NUMBER_OF_SAM_SITES; iCounter++ ) + for( iCounter = 0; iCounter < NUMBER_OF_SAMS; iCounter++ ) { // has the sam site here been found? if( !fSamSiteFound[ iCounter ] ) diff --git a/Strategic/Queen Command.cpp b/Strategic/Queen Command.cpp index b8088dd9..e39ffca2 100644 --- a/Strategic/Queen Command.cpp +++ b/Strategic/Queen Command.cpp @@ -1121,11 +1121,14 @@ void AddPossiblePendingEnemiesToBattle() GROUP *pGroup; SECTORINFO *pSector = &SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY ) ]; static UINT8 ubPredefinedInsertionCode = 255; + + // check if no world is loaded + if ( !gWorldSectorX && !gWorldSectorY && (gbWorldSectorZ == -1) ) + return; if( ( !PlayerMercsInSector( (UINT8)gWorldSectorX, (UINT8)gWorldSectorY, 0 ) && !CountAllMilitiaInSector( gWorldSectorX, gWorldSectorY ) ) || !NumEnemiesInSector( gWorldSectorX, gWorldSectorY ) ) return; - /* if( !gfPendingEnemies ) { //Optimization. No point in checking if we know that there aren't any more enemies that can //be added to this battle. This changes whenever a new enemy group arrives at the scene. diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 962f2ede..c21a4812 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -5246,7 +5246,7 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent ) UINT8 ubSamIndex; // ALT-F9: Reveal all SAM sites - for( ubSamIndex = 0; ubSamIndex < NUMBER_OF_SAM_SITES; ubSamIndex++ ) + for( ubSamIndex = 0; ubSamIndex < NUMBER_OF_SAMS; ubSamIndex++ ) { SetSAMSiteAsFound( ubSamIndex ); } diff --git a/Strategic/strategicmap.cpp b/Strategic/strategicmap.cpp index 99ea7893..c27cd47a 100644 --- a/Strategic/strategicmap.cpp +++ b/Strategic/strategicmap.cpp @@ -4249,7 +4249,7 @@ INT8 GetSAMIdFromSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ ) sSectorValue = SECTOR( sSectorX, sSectorY ); // run through list of sam sites - for( bCounter = 0; bCounter < 4; bCounter++ ) + for( bCounter = 0; bCounter < NUMBER_OF_SAMS; bCounter++ ) { if( pSamList[ bCounter ] == sSectorValue ) {