Update inventory arrays to be vectors. Add class for inventory. Change some structs that use inventories to classes to provide constructors, destructors, etc. Note that with this update all file operations should still be compatible with previous files.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@969 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
SpaceViking
2007-06-15 02:57:16 +00:00
parent 183ee2005f
commit d24bb86686
+6 -2
View File
@@ -722,7 +722,9 @@ void WriteOutCurrentImpCharacter( INT32 iProfileId, STR fileName )
}
// write out the profile itself
if (!FileWrite(hFile, &gMercProfiles[ iProfileId ], sizeof( MERCPROFILESTRUCT ), &uiBytesWritten))
// WDS - Clean up inventory handling
gMercProfiles[ iProfileId ].CopyNewInventoryToOld();
if (!FileWrite(hFile, &gMercProfiles[ iProfileId ], SIZEOF_MERCPROFILESTRUCT_POD, &uiBytesWritten))
{
if (hFile)
FileClose(hFile);
@@ -794,11 +796,13 @@ BOOLEAN LoadImpCharacter( STR nickName )
LaptopSaveInfo.iIMPIndex = iProfileId;
// read in the profile
if (!FileRead(hFile, &gMercProfiles[ iProfileId ] ,sizeof( MERCPROFILESTRUCT ), &uiBytesRead))
// WDS - Clean up inventory handling
if (!FileRead(hFile, &gMercProfiles[ iProfileId ] , SIZEOF_MERCPROFILESTRUCT_POD, &uiBytesRead))
{
DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 7 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
return FALSE;
}
gMercProfiles[ iProfileId ].CopyOldInventoryToNew();
// close file
FileClose(hFile);