From 76558e9313c481c39f40b2c73c4a3f68bf560d4e Mon Sep 17 00:00:00 2001 From: withmorten Date: Mon, 19 Jul 2021 23:39:56 +0200 Subject: fix garbage data written in garage save block --- src/control/Garages.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index d7394902..34ed11eb 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -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); -- cgit v1.2.3