From a437d2bc2611166b9dbbe3072cea9f9307b98838 Mon Sep 17 00:00:00 2001 From: withmorten Date: Mon, 19 Jul 2021 23:39:19 +0200 Subject: fix garbage data written in garage save block --- src/control/Garages.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/control/Garages.cpp') diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index 91971ae7..245e961d 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -2305,6 +2305,9 @@ void CGarages::Save(uint8 * buf, uint32 * size) *size = (6 * sizeof(uint32) + TOTAL_COLLECTCARS_GARAGES * sizeof(*CarTypesCollected) + sizeof(uint32) + 3 * NUM_GARAGE_STORED_CARS * sizeof(CStoredCar) + NUM_GARAGES * sizeof(CGarage)); #else * size = 5484; +#endif +#if !defined THIS_IS_STUPID && !defined FIX_GARAGE_SIZE && defined COMPATIBLE_SAVES + memset(buf + 5240, 0, *size - 5240); // garbage data is written otherwise #endif CloseHideOutGaragesBeforeSave(); WriteSaveBuf(buf, NumGarages); -- cgit v1.2.3