Mercurial > mm7
diff SaveLoad.cpp @ 2178:43175acce099
savegame fix
author | Ritor1 |
---|---|
date | Wed, 22 Jan 2014 00:05:10 +0600 |
parents | e1199b655710 |
children | f0b5ca2dfb73 |
line wrap: on
line diff
--- a/SaveLoad.cpp Tue Jan 21 18:45:00 2014 +0600 +++ b/SaveLoad.cpp Wed Jan 22 00:05:10 2014 +0600 @@ -442,16 +442,16 @@ } memcpy(data_write_pos, &uNumActors, 4); data_write_pos += 4; - memcpy(data_write_pos, pActors.data(), 836 * uNumActors); - data_write_pos += 836 * uNumActors; + memcpy(data_write_pos, &pActors, uNumActors * sizeof(Actor)); + data_write_pos += uNumActors * sizeof(Actor); memcpy(data_write_pos, &uNumSpriteObjects, 4); data_write_pos += 4; - memcpy(data_write_pos, pSpriteObjects.data(), 112 * uNumSpriteObjects); - data_write_pos += 112 * uNumSpriteObjects; + memcpy(data_write_pos, &pSpriteObjects, uNumSpriteObjects * sizeof(SpriteObject)); + data_write_pos += uNumSpriteObjects * sizeof(SpriteObject); memcpy(data_write_pos, &uNumChests, 4); data_write_pos += 4; memcpy(data_write_pos, pChests.data(), sizeof(Chest)* uNumChests); - data_write_pos += sizeof(Chest)* uNumChests; + data_write_pos += sizeof(Chest) * uNumChests; memcpy(data_write_pos, &stru_5E4C90_MapPersistVars, 0xC8); data_write_pos += 200; memcpy(data_write_pos, &pOutdoor->loc_time, 0x38); @@ -459,6 +459,7 @@ } strcpy(Source, pCurrentMapName); _splitpath(Source, Drive, Dir, Filename, Ext); + Ext[1] = 'd'; Size = (int)data_write_pos - (int)uncompressed_buff; compressed_block_size = 999984; @@ -534,20 +535,10 @@ } // 4E28F8: using guessed type int pCurrentScreen; - - - - - - - - - - //----- (0045E297) -------------------------------------------------------- void SavegameList::Initialize(unsigned int bHideEmptySlots) { - memset(pSavegameList, 0, 0x3138); + memset(pSavegameList, 0, sizeof(pSavegameList)); // Reset(); uNumSavegameFiles = 0;