mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
- Bugfix: After loading a game, mercs gearkits are bugged and game crashes when hiring a merc (by silversurfer)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6237 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+9
-9
@@ -5959,19 +5959,19 @@ BOOLEAN LoadSavedMercProfiles( HWFILE hFile )
|
|||||||
if(guiCurrentSaveGameVersion < STOMP12_SAVEGAME_DATATYPE_CHANGE && cnt >= NUM_PROFILES_v111)
|
if(guiCurrentSaveGameVersion < STOMP12_SAVEGAME_DATATYPE_CHANGE && cnt >= NUM_PROFILES_v111)
|
||||||
break;
|
break;
|
||||||
// silversurfer: What if mercs are added while we are mid game?
|
// silversurfer: What if mercs are added while we are mid game?
|
||||||
// let's load the savegame data into a placeholder
|
// let's store the current data in a placeholder
|
||||||
if ( !tempMercProfile.Load(hFile, false, false, true) )
|
tempMercProfile = gMercProfiles[cnt];
|
||||||
return(FALSE);
|
// now load the merc data from savegame
|
||||||
// and check if it contains valid merc data
|
// Changed by ADB, rev 1513
|
||||||
// only then overwrite what we read from the MercProfiles.xml
|
|
||||||
if ( tempMercProfile.bLifeMax > 0 )
|
|
||||||
memcpy( &gMercProfiles[cnt], &tempMercProfile, sizeof(gMercProfiles[cnt]) );
|
|
||||||
/* // 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);
|
||||||
}*/
|
}
|
||||||
|
// now check if we loaded a valid merc profile
|
||||||
|
// if not then overwrite with the previously stored data
|
||||||
|
if ( gMercProfiles[cnt].bLifeMax <= 0 )
|
||||||
|
gMercProfiles[cnt] = tempMercProfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
|
|||||||
Reference in New Issue
Block a user