diff --git a/JA2.suo b/JA2.suo index 59dd9d8a..4d3380e1 100644 Binary files a/JA2.suo and b/JA2.suo differ diff --git a/Laptop/AimMembers.cpp b/Laptop/AimMembers.cpp index 6507f135..38c9c799 100644 --- a/Laptop/AimMembers.cpp +++ b/Laptop/AimMembers.cpp @@ -1782,10 +1782,10 @@ INT8 AimMemberHireMerc() //if we succesfully hired the merc bReturnCode = HireMerc( &HireMercStruct ); - if( bReturnCode == MERC_HIRE_OVER_20_MERCS_HIRED ) + if( bReturnCode == MERC_HIRE_OVER_18_MERCS_HIRED ) { - //display a warning saying u cant hire more then 20 mercs - DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_20_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); + //display a warning saying u cant hire more than 18 mercs + DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_18_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); return(FALSE); } else if( bReturnCode == MERC_HIRE_FAILED ) @@ -4167,10 +4167,10 @@ BOOLEAN QuickHireMerc() SetFlagToForceHireMerc( TRUE ); bReturnCode = HireMerc( &HireMercStruct ); SetFlagToForceHireMerc( FALSE ); - if( bReturnCode == MERC_HIRE_OVER_20_MERCS_HIRED ) + if( bReturnCode == MERC_HIRE_OVER_18_MERCS_HIRED ) { - //display a warning saying u cant hire more then 20 mercs - DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_20_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); + //display a warning saying u cant hire more than 18 mercs + DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_18_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); return(FALSE); } else if( bReturnCode == MERC_HIRE_FAILED ) diff --git a/Laptop/IMP HomePage.cpp b/Laptop/IMP HomePage.cpp index 589c4ab8..eb62a09c 100644 --- a/Laptop/IMP HomePage.cpp +++ b/Laptop/IMP HomePage.cpp @@ -383,16 +383,27 @@ void HandleTextEvent( UINT32 uiKey ) void ProcessPlayerInputActivationString( void ) { // prcess string to see if it matches activation string - - if( NumberOfMercsOnPlayerTeam() >= 18 ) - return; - char charPlayerActivationString[32]; wcstombs(charPlayerActivationString,pPlayerActivationString,32); + BOOLEAN freeMercSlot = TRUE; + + // WANNE: Check total number of hired mercs + if( NumberOfMercsOnPlayerTeam() >= 18 ) + { + freeMercSlot = FALSE; + } + //Madd multiple imps if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) )&&( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) ) if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) ) { + // WANNE: Check total number of hired mercs + if( freeMercSlot == FALSE ) + { + DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_18_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); + return; + } + if (GetFilledIMPSlots(-1) < gGameExternalOptions.iMaxIMPCharacters) { // Kaiden: Need to reset skills, attributes and personalities with the new UB Method. @@ -408,6 +419,13 @@ void ProcessPlayerInputActivationString( void ) //Madd multiple imps else if( ( wcscmp(pPlayerActivationString, L"90210") == 0 ) && ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) ) else if( wcscmp(pPlayerActivationString, L"90210") == 0 ) { + // WANNE: Check total number of hired mercs + if( freeMercSlot == FALSE ) + { + DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_18_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); + return; + } + if (GetFilledIMPSlots(-1) < gGameExternalOptions.iMaxIMPCharacters) { if (LoadImpCharacter( IMP_MERC_FILENAME ) == TRUE) @@ -424,6 +442,13 @@ void ProcessPlayerInputActivationString( void ) // Madd: load characters by name else if ( ImpExists( charPlayerActivationString ) ) { + // WANNE: Check total number of hired mercs + if( freeMercSlot == FALSE ) + { + DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_18_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); + return; + } + if (GetFilledIMPSlots(-1) < gGameExternalOptions.iMaxIMPCharacters) { if (LoadImpCharacter( charPlayerActivationString ) == TRUE) diff --git a/Laptop/mercs Files.cpp b/Laptop/mercs Files.cpp index 23ba59a9..89cd1d20 100644 --- a/Laptop/mercs Files.cpp +++ b/Laptop/mercs Files.cpp @@ -650,7 +650,7 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID) bReturnCode = HireMerc( &HireMercStruct ); //already have 20 mercs on the team - if( bReturnCode == MERC_HIRE_OVER_20_MERCS_HIRED ) + if( bReturnCode == MERC_HIRE_OVER_18_MERCS_HIRED ) { DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, MercInfo[ MERC_FILES_HIRE_TO_MANY_PEOPLE_WARNING ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); return(FALSE); diff --git a/Strategic/Town Militia.cpp b/Strategic/Town Militia.cpp index a9070cdc..5ce3c646 100644 --- a/Strategic/Town Militia.cpp +++ b/Strategic/Town Militia.cpp @@ -336,7 +336,7 @@ void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRa SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] ); // damn well better have that many around to promote! - Assert(pSectorInfo->ubNumberOfCivsAtLevel[ ubCurrentRank ] >= ubHowMany); + //Assert(pSectorInfo->ubNumberOfCivsAtLevel[ ubCurrentRank ] >= ubHowMany); //KM : July 21, 1999 patch fix if( pSectorInfo->ubNumberOfCivsAtLevel[ ubCurrentRank ] < ubHowMany ) diff --git a/Tactical/Handle UI.cpp b/Tactical/Handle UI.cpp index 47eeb24a..69769326 100644 --- a/Tactical/Handle UI.cpp +++ b/Tactical/Handle UI.cpp @@ -1063,9 +1063,9 @@ UINT32 UIHandleNewMerc( UI_EVENT *pUIEvent ) { ScreenMsg( FONT_ORANGE, MSG_BETAVERSION, L"Merc hire failed: Either already hired or dislikes you." ); } - else if( bReturnCode == MERC_HIRE_OVER_20_MERCS_HIRED ) + else if( bReturnCode == MERC_HIRE_OVER_18_MERCS_HIRED ) { - ScreenMsg( FONT_ORANGE, MSG_BETAVERSION, L"Can't hire more than 20 mercs." ); + ScreenMsg( FONT_ORANGE, MSG_BETAVERSION, L"Can't hire more than 18 mercs." ); } else { diff --git a/Tactical/Merc Hiring.cpp b/Tactical/Merc Hiring.cpp index bf196113..5c8b0882 100644 --- a/Tactical/Merc Hiring.cpp +++ b/Tactical/Merc Hiring.cpp @@ -92,7 +92,7 @@ INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc) return( MERC_HIRE_FAILED ); if( NumberOfMercsOnPlayerTeam() >= 18 ) - return( MERC_HIRE_OVER_20_MERCS_HIRED ); + return( MERC_HIRE_OVER_18_MERCS_HIRED ); // ATE: if we are to use landing zone, update to latest value // they will be updated again just before arrival... diff --git a/Tactical/Merc Hiring.h b/Tactical/Merc Hiring.h index e1b72c0e..032eaa11 100644 --- a/Tactical/Merc Hiring.h +++ b/Tactical/Merc Hiring.h @@ -7,7 +7,7 @@ // // Used with the HireMerc function // -#define MERC_HIRE_OVER_20_MERCS_HIRED -1 +#define MERC_HIRE_OVER_18_MERCS_HIRED -1 #define MERC_HIRE_FAILED 0 #define MERC_HIRE_OK 1 diff --git a/Tactical/Soldier Init List.cpp b/Tactical/Soldier Init List.cpp index 5cc06b7d..97244989 100644 --- a/Tactical/Soldier Init List.cpp +++ b/Tactical/Soldier Init List.cpp @@ -2343,6 +2343,13 @@ void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT8 ubNu UINT8 ubCurrSlot; UINT8 ubTotalSoldiers; UINT8 bDesiredDirection=0; + + ubTotalSoldiers = ubNumGreen + ubNumReg + ubNumElites; + + // WANNE: If we have no militia soldiers -> exit! + if (ubTotalSoldiers == 0) + return; + switch( ubStrategicInsertionCode ) { case INSERTION_CODE_NORTH: bDesiredDirection = SOUTHEAST; break; @@ -2355,8 +2362,6 @@ void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT8 ubNu ScreenMsg( FONT_RED, MSG_INTERFACE, L"Militia reinforcements have arrived! (%d admins, %d troops, %d elite)", ubNumGreen, ubNumReg, ubNumElites ); #endif - ubTotalSoldiers = ubNumGreen + ubNumReg + ubNumElites; - ChooseMapEdgepoints( &MapEdgepointInfo, ubStrategicInsertionCode, (UINT8)(ubNumGreen + ubNumReg + ubNumElites) ); ubCurrSlot = 0; while( ubTotalSoldiers ) diff --git a/Utils/Text.h b/Utils/Text.h index 4108245f..6b7ab2db 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -987,7 +987,7 @@ enum AIM_MEMBER_LEAVE_MSG, AIM_MEMBER_DEAD, - AIM_MEMBER_ALREADY_HAVE_20_MERCS, + AIM_MEMBER_ALREADY_HAVE_18_MERCS, AIM_MEMBER_PRERECORDED_MESSAGE, AIM_MEMBER_MESSAGE_RECORDED,