Changing MAX_NUMBER_PLAYER_MERCS midgame no longer renders savegames unloadable, as the teamsize is stored in the savegame anyway

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6294 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-08-19 23:27:50 +00:00
parent 4b0094902a
commit 74f52b3982
11 changed files with 29 additions and 17 deletions
+16 -7
View File
@@ -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) {