summaryrefslogtreecommitdiffstats
path: root/src/save
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-07-04 14:24:54 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2021-07-04 14:24:54 +0200
commit62425b586631f95d67f2c9ba8c9a4f202e03bda4 (patch)
tree418a28a718cfe01cc0b8a224e0c1bab6a75de26a /src/save
parentMerge remote-tracking branch 'upstream/lcs' into lcs (diff)
parentMerge branch 'miami' into lcs (diff)
downloadre3-62425b586631f95d67f2c9ba8c9a4f202e03bda4.tar
re3-62425b586631f95d67f2c9ba8c9a4f202e03bda4.tar.gz
re3-62425b586631f95d67f2c9ba8c9a4f202e03bda4.tar.bz2
re3-62425b586631f95d67f2c9ba8c9a4f202e03bda4.tar.lz
re3-62425b586631f95d67f2c9ba8c9a4f202e03bda4.tar.xz
re3-62425b586631f95d67f2c9ba8c9a4f202e03bda4.tar.zst
re3-62425b586631f95d67f2c9ba8c9a4f202e03bda4.zip
Diffstat (limited to 'src/save')
-rw-r--r--src/save/GenericGameStorage.cpp5
-rw-r--r--src/save/SaveBuf.h36
2 files changed, 23 insertions, 18 deletions
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index cbd4e2a4..7921b22a 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -251,6 +251,11 @@ GenericSave(int file)
WriteSaveDataBlock(CStreaming::MemoryCardSave, "StreamingSize");
WriteSaveDataBlock(CPedType::Save, "PedTypeSize");
+ // sure just write garbage data repeatedly ...
+#ifndef THIS_IS_STUPID
+ memset(work_buff, 0, sizeof(work_buff));
+#endif
+
// Write padding
for (int i = 0; i < 4; i++) {
size = align4bytes(SIZE_OF_ONE_GAME_IN_BYTES - totalSize - 4);
diff --git a/src/save/SaveBuf.h b/src/save/SaveBuf.h
index de27017e..6e9b3ae9 100644
--- a/src/save/SaveBuf.h
+++ b/src/save/SaveBuf.h
@@ -83,29 +83,29 @@ WriteSaveBuf(uint8 *&buf, uint32 &length, const T &value)
#ifdef VALIDATE_SAVE_SIZE
#define CheckSaveHeader(buf, a, b, c, d, size) do { \
- char _C; uint32 _size;\
- ReadSaveBuf(&_C, buf);\
- assert(_C == a);\
- ReadSaveBuf(&_C, buf);\
- assert(_C == b);\
- ReadSaveBuf(&_C, buf);\
- assert(_C == c);\
- ReadSaveBuf(&_C, buf);\
- assert(_C == d);\
+ char _c; uint32 _size;\
+ ReadSaveBuf(&_c, buf);\
+ assert(_c == a);\
+ ReadSaveBuf(&_c, buf);\
+ assert(_c == b);\
+ ReadSaveBuf(&_c, buf);\
+ assert(_c == c);\
+ ReadSaveBuf(&_c, buf);\
+ assert(_c == d);\
ReadSaveBuf(&_size, buf);\
assert(_size == size);\
} while(0)
#define CheckSaveHeaderWithLength(buf,len,a,b,c,d,size) do { \
- char _C; uint32 _size;\
- ReadSaveBuf(&_C, buf, len);\
- assert(_C == a);\
- ReadSaveBuf(&_C, buf, len);\
- assert(_C == b);\
- ReadSaveBuf(&_C, buf, len);\
- assert(_C == c);\
- ReadSaveBuf(&_C, buf, len);\
- assert(_C == d);\
+ char _c; uint32 _size;\
+ ReadSaveBuf(&_c, buf, len);\
+ assert(_c == a);\
+ ReadSaveBuf(&_c, buf, len);\
+ assert(_c == b);\
+ ReadSaveBuf(&_c, buf, len);\
+ assert(_c == c);\
+ ReadSaveBuf(&_c, buf, len);\
+ assert(_c == d);\
ReadSaveBuf(&_size, buf, len);\
assert(_size == size);\
} while(0)