mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +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)
|
||||
break;
|
||||
// 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 )
|
||||
memcpy( &gMercProfiles[cnt], &tempMercProfile, sizeof(gMercProfiles[cnt]) );
|
||||
/* // Changed by ADB, rev 1513
|
||||
// let's store the current data in a placeholder
|
||||
tempMercProfile = gMercProfiles[cnt];
|
||||
// now load the merc data from savegame
|
||||
// Changed by ADB, rev 1513
|
||||
//if ( !gMercProfiles[cnt].Load(hFile, false) )
|
||||
if ( !gMercProfiles[cnt].Load(hFile, false, false, true) )
|
||||
{
|
||||
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 );
|
||||
|
||||
Reference in New Issue
Block a user