mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
- 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:
+11
-2
@@ -5951,18 +5951,27 @@ BOOLEAN SaveMercProfiles( HWFILE hFile )
|
|||||||
BOOLEAN LoadSavedMercProfiles( HWFILE hFile )
|
BOOLEAN LoadSavedMercProfiles( HWFILE hFile )
|
||||||
{
|
{
|
||||||
UINT16 cnt;
|
UINT16 cnt;
|
||||||
|
MERCPROFILESTRUCT tempMercProfile;
|
||||||
//Loop through all the profiles to Load
|
//Loop through all the profiles to Load
|
||||||
for( cnt=0; cnt< NUM_PROFILES; cnt++)
|
for( cnt=0; cnt< NUM_PROFILES; cnt++)
|
||||||
{
|
{
|
||||||
// At some point after STOMP12_SAVEGAME_DATATYPE_CHANGE, NUM_PROFILES was changed from NUM_PROFILES_v111
|
// 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)
|
if(guiCurrentSaveGameVersion < STOMP12_SAVEGAME_DATATYPE_CHANGE && cnt >= NUM_PROFILES_v111)
|
||||||
break;
|
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) )
|
||||||
if ( !gMercProfiles[cnt].Load(hFile, false, false, true) )
|
if ( !gMercProfiles[cnt].Load(hFile, false, false, true) )
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
|
|||||||
Reference in New Issue
Block a user