fix garbage data written in garage save block

This commit is contained in:
withmorten 2021-07-19 23:39:56 +02:00
parent c937bdbfea
commit 76558e9313
1 changed files with 3 additions and 0 deletions

View File

@ -2259,6 +2259,9 @@ void CGarages::Save(uint8 * buf, uint32 * size)
//INITSAVEBUF
*size = 7876; // for some reason it's not actual size again
//*size = (6 * sizeof(uint32) + TOTAL_COLLECTCARS_GARAGES * sizeof(*CarTypesCollected) + sizeof(uint32) + TOTAL_HIDEOUT_GARAGES * NUM_GARAGE_STORED_CARS * sizeof(CStoredCar) + NUM_GARAGES * sizeof(CGarage));
#if !defined THIS_IS_STUPID && defined COMPATIBLE_SAVES
memset(buf + 7340, 0, *size - 7340); // garbage data is written otherwise
#endif
CloseHideOutGaragesBeforeSave();
WriteSaveBuf(buf, NumGarages);
WriteSaveBuf(buf, (uint32)BombsAreFree);