diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index 46d3be8c..6bf17f0c 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -770,7 +770,7 @@ bool FILESYSTEM_loadBinaryBlob(binaryBlob* blob, const char* filename) { PHYSFS_sint64 size; PHYSFS_File* handle; - int offset; + int valid, offset; size_t i; char path[MAX_PATH]; @@ -796,6 +796,7 @@ bool FILESYSTEM_loadBinaryBlob(binaryBlob* blob, const char* filename) sizeof(blob->m_headers) ); + valid = 0; offset = sizeof(blob->m_headers); for (i = 0; i < SDL_arraysize(blob->m_headers); ++i) @@ -828,15 +829,20 @@ bool FILESYSTEM_loadBinaryBlob(binaryBlob* blob, const char* filename) } PHYSFS_readBytes(handle, *memblock, header->size); offset += header->size; + valid += 1; continue; - fail: header->valid = false; } PHYSFS_close(handle); + if (valid == 0) + { + return false; + } + printf("The complete reloaded file size: %lli\n", size); for (i = 0; i < SDL_arraysize(blob->m_headers); ++i)