ggpo: savestate md5 wasn't computed

This commit is contained in:
Flyinghead 2021-10-21 12:03:04 +02:00
parent e0437ab447
commit 037339f3be
2 changed files with 10 additions and 0 deletions

View File

@ -32,6 +32,7 @@ public:
size_t Size() const { return size; }
size_t Read(void *data, size_t length);
size_t Write(const void *data, size_t length);
FILE *rawFile() const { return file; }
private:
FILE *file = nullptr;

View File

@ -160,6 +160,15 @@ void dc_loadstate(int index)
if (zipFile.Open(filename, false))
{
total_size = (u32)zipFile.Size();
if (index == -1 && config::GGPOEnable)
{
f = zipFile.rawFile();
long pos = std::ftell(f);
MD5Sum().add(f)
.getDigest(settings.network.md5.savestate);
std::fseek(f, pos, SEEK_SET);
f = nullptr;
}
}
else
{