mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
+8
-8
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user