diff --git a/Laptop/AimMembers.cpp b/Laptop/AimMembers.cpp index 09841b77d..32edab8aa 100644 --- a/Laptop/AimMembers.cpp +++ b/Laptop/AimMembers.cpp @@ -2457,7 +2457,7 @@ void BtnAuthorizeButtonCallback(GUI_BUTTON *btn,INT32 reason) // WDS DEBUG if (LaptopSaveInfo.iCurrentBalance == 4500001) { unsigned hired = 0; - while (hired < gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs) { + while (hired < OUR_TEAM_SIZE_NO_VEHICLE) { if (AimMemberHireMerc()) { // giIdOfLastHiredMerc = AimMercArray[gbCurrentIndex]; giIdOfLastHiredMerc = gAimAvailability[AimMercArray[gbCurrentIndex]].ProfilId; diff --git a/Laptop/IMP HomePage.cpp b/Laptop/IMP HomePage.cpp index 294e41a35..cec089432 100644 --- a/Laptop/IMP HomePage.cpp +++ b/Laptop/IMP HomePage.cpp @@ -26,6 +26,7 @@ #include "Game Clock.h" // WDS - make number of mercenaries, etc. be configurable #include "Squads.h" + #include "Overhead.h" // added by Flugente for OUR_TEAM_SIZE_NO_VEHICLE #endif #ifdef JA2UB @@ -383,7 +384,7 @@ void ProcessPlayerInputActivationString( void ) BOOLEAN freeMercSlot = TRUE; // WANNE: Check total number of hired mercs - if( NumberOfMercsOnPlayerTeam() >= gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs ) + if( NumberOfMercsOnPlayerTeam() >= OUR_TEAM_SIZE_NO_VEHICLE ) { freeMercSlot = FALSE; } diff --git a/Laptop/IMP MainPage.cpp b/Laptop/IMP MainPage.cpp index d10ffa53f..c003b844f 100644 --- a/Laptop/IMP MainPage.cpp +++ b/Laptop/IMP MainPage.cpp @@ -22,6 +22,7 @@ #include "GameSettings.h" #include "Soldier Profile.h" #include "Squads.h" + #include "Overhead.h" // added by Flugente for OUR_TEAM_SIZE_NO_VEHICLE #endif #include "IMP Confirm.h" @@ -603,7 +604,7 @@ void BtnIMPMainPageBeginCallback(GUI_BUTTON *btn,INT32 reason) DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 3 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, BeginMessageBoxCallBack); } - else if( NumberOfMercsOnPlayerTeam() >= gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs ) + else if( NumberOfMercsOnPlayerTeam() >= OUR_TEAM_SIZE_NO_VEHICLE ) { DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 5 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, BeginMessageBoxCallBack); } diff --git a/SaveLoadGame.cpp b/SaveLoadGame.cpp index 276618a4a..e487bd00b 100644 --- a/SaveLoadGame.cpp +++ b/SaveLoadGame.cpp @@ -6988,16 +6988,25 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile ) errMsgTxt[4] = Additional113Text[6]; bool needToRejigger = false; - for (int idx = OUR_TEAM; idx <= CIV_TEAM; ++idx) { - if ((cntFromFile[ idx ] > cntFromIni[ idx ]) || ((cntFromFile[ idx ] < cntFromIni[ idx ]) && (idx == OUR_TEAM))) { - CHAR16 errorMessage[512]; + for (int idx = OUR_TEAM; idx <= CIV_TEAM; ++idx) + { + // Flugente: for OUR_TEAM, from no on we use (gTacticalStatus.Team[ OUR_TEAM ].bLastID - gTacticalStatus.Team[ OUR_TEAM ].bFirstID + 1) instead of + // gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs + gGameExternalOptions.ubGameMaximumNumberOfPlayerVehicles (defined in OUR_TEAM_SIZE_NO_VEHICLE). + // As a result, this check isn't needed anymore, as the number stays fixed (it always stayed fixed, as one couldn't continue the game if one altered it, + // which raises the question of why we even checked that...) + /*if ((cntFromFile[ idx ] > cntFromIni[ idx ]) || ((cntFromFile[ idx ] < cntFromIni[ idx ]) && (idx == OUR_TEAM))) + { + CHAR16 errorMessage[512]; swprintf(errorMessage, Additional113Text[1], errMsgTxt [ idx ], cntFromFile[ idx ], cntFromIni[ idx ]); - DoScreenIndependantMessageBox(errorMessage, MSG_BOX_FLAG_OK, FailedLoadingGameCallBack ); - return FALSE; - } else if (cntFromFile[ idx ] < cntFromIni[ idx ]) { + DoScreenIndependantMessageBox(errorMessage, MSG_BOX_FLAG_OK, FailedLoadingGameCallBack ); + return FALSE; + } + else*/ if (idx != OUR_TEAM && cntFromFile[ idx ] < cntFromIni[ idx ]) + { needToRejigger = true; + } } - } + if (needToRejigger) { // The .ini file asked for more slots than were in the save file, so expand the slots for (int teamIdx = OUR_TEAM; teamIdx <= CIV_TEAM; ++teamIdx) { diff --git a/Strategic/Auto Resolve.cpp b/Strategic/Auto Resolve.cpp index a8073d576..c4c36996f 100644 --- a/Strategic/Auto Resolve.cpp +++ b/Strategic/Auto Resolve.cpp @@ -3653,7 +3653,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve3"); case '?': if( CHEATER_CHEAT_LEVEL() ) { - gpAR->ubMercs = gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs; + gpAR->ubMercs = OUR_TEAM_SIZE_NO_VEHICLE; gpAR->ubCivs = MAX_AR_TEAM_SIZE; gpAR->ubEnemies = gGameExternalOptions.ubGameMaximumNumberOfEnemies; fResetAutoResolve = TRUE; diff --git a/Strategic/PreBattle Interface.cpp b/Strategic/PreBattle Interface.cpp index 5ab72ed1c..f73455dff 100644 --- a/Strategic/PreBattle Interface.cpp +++ b/Strategic/PreBattle Interface.cpp @@ -97,7 +97,7 @@ enum //GraphicIDs for the panel //The start of the black space #define TOP_Y 113 //The end of the black space -#define BOTTOM_Y (349+(gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs-18)*ROW_HEIGHT) +#define BOTTOM_Y (349+(OUR_TEAM_SIZE_NO_VEHICLE-18)*ROW_HEIGHT) //#define BOTTOM_Y 349 //The internal height of the uninvolved panel #define INTERNAL_HEIGHT 27 @@ -1235,7 +1235,7 @@ void RenderPreBattleInterface() } // WDS - make number of mercenaries, etc. be configurable - for( i = 0; i < (INT32)(/*21*/3+gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs - max( guiNumUninvolved, 1 )); i++ ) + for( i = 0; i < (INT32)(/*21*/3+ OUR_TEAM_SIZE_NO_VEHICLE - max( guiNumUninvolved, 1 )); i++ ) { y = TOP_Y + ROW_HEIGHT * i; BltVideoObject( guiSAVEBUFFER, hVObject, TOP_COLUMN, 186 + xResOffset, y, VO_BLT_SRCTRANSPARENCY, NULL ); diff --git a/Tactical/Interface Dialogue.cpp b/Tactical/Interface Dialogue.cpp index ba0d6155a..7d59e70c7 100644 --- a/Tactical/Interface Dialogue.cpp +++ b/Tactical/Interface Dialogue.cpp @@ -4580,7 +4580,7 @@ UINT32 CalcMedicalCost( UINT8 ubId ) BOOLEAN PlayerTeamHasTwoSpotsLeft( ) { - return ( CountNonVehiclesOnPlayerTeam() <= gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs - 2 ); + return ( CountNonVehiclesOnPlayerTeam() <= OUR_TEAM_SIZE_NO_VEHICLE - 2 ); } diff --git a/Tactical/Merc Hiring.cpp b/Tactical/Merc Hiring.cpp index 3391721de..30261a44f 100644 --- a/Tactical/Merc Hiring.cpp +++ b/Tactical/Merc Hiring.cpp @@ -146,7 +146,7 @@ INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc) //hayden, 7 member team limit setable in ini - if( NumberOfMercsOnPlayerTeam() >= gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs || (is_client && NumberOfMercsOnPlayerTeam() >= cMaxMercs) ) + if( NumberOfMercsOnPlayerTeam() >= OUR_TEAM_SIZE_NO_VEHICLE || (is_client && NumberOfMercsOnPlayerTeam() >= cMaxMercs) ) return( MERC_HIRE_OVER_PLAYER_LIMIT ); // ATE: if we are to use landing zone, update to latest value diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index ae2a2d197..1e3b88f52 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -7361,7 +7361,7 @@ UINT32 CountNonVehiclesOnPlayerTeam( ) BOOLEAN PlayerTeamFull( ) { // last ID for the player team is 19, so long as we have at most 17 non-vehicles... - if ( CountNonVehiclesOnPlayerTeam() < gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs /*gTacticalStatus.Team[ gbPlayerNum ].bLastID - 2*/ ) + if ( CountNonVehiclesOnPlayerTeam() < OUR_TEAM_SIZE_NO_VEHICLE /*gTacticalStatus.Team[ gbPlayerNum ].bLastID - 2*/ ) { return( FALSE ); } diff --git a/Tactical/Overhead.h b/Tactical/Overhead.h index bceab9cac..9e91bfb40 100644 --- a/Tactical/Overhead.h +++ b/Tactical/Overhead.h @@ -195,6 +195,7 @@ extern BOOLEAN gfMovingAnimation; extern TacticalStatusType gTacticalStatus; +#define OUR_TEAM_SIZE_NO_VEHICLE (gTacticalStatus.Team[ OUR_TEAM ].bLastID - gTacticalStatus.Team[ OUR_TEAM ].bFirstID + 1 - gGameExternalOptions.ubGameMaximumNumberOfPlayerVehicles) BOOLEAN InitTacticalEngine( ); diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index dee68bf08..7410066ba 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -2765,7 +2765,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) //no crates in sector inventory. search merc inventories if(!mergeSuccessful) { - for(int loop=0; loop<(int)gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs; loop++) + for(int loop=0; loop<(int)OUR_TEAM_SIZE_NO_VEHICLE; ++loop) { if(MercPtrs[loop]->bActive && MercPtrs[loop]->bInSector) {