Fix: Having lower (and invalid) team size values in Ja2_Options.ini than in the savegame could lead to crashes. I put back the check and warning message for this case. Having higher numbers in the ini is ok.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7590 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2014-10-18 19:54:50 +00:00
parent f05cdc3286
commit 74845ec5b9
10 changed files with 18 additions and 17 deletions
+8 -8
View File
@@ -7498,17 +7498,17 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile )
// 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 (idx != OUR_TEAM && cntFromFile[ idx ] < cntFromIni[ idx ])
if (idx != OUR_TEAM && cntFromFile[ idx ] < cntFromIni[ idx ])
{
needToRejigger = true;
}
else if (cntFromFile[ idx ] > cntFromIni[ idx ])
{
CHAR16 errorMessage[512];
swprintf(errorMessage, Additional113Text[ADDTEXT_WRONG_TEAM_SIZE], errMsgTxt [ idx ], cntFromFile[ idx ], cntFromIni[ idx ]);
DoScreenIndependantMessageBox(errorMessage, MSG_BOX_FLAG_OK, FailedLoadingGameCallBack );
return FALSE;
}
}
if (needToRejigger) {