From 502f5f6b770d7a29a2240e55b13d815a80f6e9e5 Mon Sep 17 00:00:00 2001 From: Wanne Date: Wed, 17 Jul 2013 18:23:03 +0000 Subject: [PATCH] - Bugfix: Re-Fixed merc records get erased (by silversurfer) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6234 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- SaveLoadGame.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/SaveLoadGame.cpp b/SaveLoadGame.cpp index 31b56d43e..5547b0773 100644 --- a/SaveLoadGame.cpp +++ b/SaveLoadGame.cpp @@ -5950,8 +5950,6 @@ BOOLEAN SaveMercProfiles( HWFILE hFile ) BOOLEAN LoadSavedMercProfiles( HWFILE hFile ) { - // Flugente 2013-07-16: This code erases merc records on loading. I am thus commenting it out until someone fixes it. -#if 0 UINT16 cnt; MERCPROFILESTRUCT tempMercProfile; //Loop through all the profiles to Load @@ -5967,7 +5965,7 @@ BOOLEAN LoadSavedMercProfiles( HWFILE hFile ) // 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; + memcpy( &gMercProfiles[cnt], &tempMercProfile, sizeof(gMercProfiles[cnt]) ); /* // Changed by ADB, rev 1513 //if ( !gMercProfiles[cnt].Load(hFile, false) ) if ( !gMercProfiles[cnt].Load(hFile, false, false, true) ) @@ -5975,22 +5973,6 @@ BOOLEAN LoadSavedMercProfiles( HWFILE hFile ) return(FALSE); }*/ } -#endif - - UINT16 cnt; - //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 - //if ( !gMercProfiles[cnt].Load(hFile, false) ) - if ( !gMercProfiles[cnt].Load(hFile, false, false, true) ) - { - return(FALSE); - } - } return( TRUE ); }