- Now it is possible to use the newly added DG M.E.R.C merc on an "older" savegame before those merc got integrated (by silversurfer)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6207 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-07-07 19:55:35 +00:00
parent 3b4d32be40
commit 739d9a47d8
+11 -2
View File
@@ -5951,18 +5951,27 @@ BOOLEAN SaveMercProfiles( HWFILE hFile )
BOOLEAN LoadSavedMercProfiles( HWFILE hFile )
{
UINT16 cnt;
MERCPROFILESTRUCT tempMercProfile;
//Loop through all the profiles to Load
for( cnt=0; cnt< NUM_PROFILES; cnt++)
{
// At some point after STOMP12_SAVEGAME_DATATYPE_CHANGE, NUM_PROFILES was changed from NUM_PROFILES_v111
if(guiCurrentSaveGameVersion < STOMP12_SAVEGAME_DATATYPE_CHANGE && cnt >= NUM_PROFILES_v111)
break;
// Changed by ADB, rev 1513
// silversurfer: What if mercs are added while we are mid game?
// let's load the savegame data into a placeholder
if ( !tempMercProfile.Load(hFile, false, false, true) )
return(FALSE);
// and check if it contains valid merc data
// only then overwrite what we read from the MercProfiles.xml
if ( tempMercProfile.bLifeMax > 0 )
gMercProfiles[cnt] = tempMercProfile;
/* // Changed by ADB, rev 1513
//if ( !gMercProfiles[cnt].Load(hFile, false) )
if ( !gMercProfiles[cnt].Load(hFile, false, false, true) )
{
return(FALSE);
}
}*/
}
return( TRUE );