mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-25 05:05:40 +00:00
fix garbage data written in garage save block
This commit is contained in:
parent
c937bdbfea
commit
76558e9313
1 changed files with 3 additions and 0 deletions
|
@ -2259,6 +2259,9 @@ void CGarages::Save(uint8 * buf, uint32 * size)
|
||||||
//INITSAVEBUF
|
//INITSAVEBUF
|
||||||
*size = 7876; // for some reason it's not actual size again
|
*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));
|
//*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();
|
CloseHideOutGaragesBeforeSave();
|
||||||
WriteSaveBuf(buf, NumGarages);
|
WriteSaveBuf(buf, NumGarages);
|
||||||
WriteSaveBuf(buf, (uint32)BombsAreFree);
|
WriteSaveBuf(buf, (uint32)BombsAreFree);
|
||||||
|
|
Loading…
Reference in a new issue