Correct SAV4Ranch's SetChecksums() passing the wrong pkEnd offset argument to UpdateMetadata() (#3918)

This commit is contained in:
Zazsona 2023-06-16 20:45:09 +01:00 committed by GitHub
parent 02eabfb10c
commit 38c7e755db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,7 +155,8 @@ public sealed class SAV4Ranch : BulkStorage, ISaveFileRevision
{
var data = Data.AsSpan();
var slotCount = GetOccupiedSlotCount();
UpdateMetadata(slotCount * SIZE_STORED);
int pkStart = PokemonCountOffset + 4;
UpdateMetadata(pkStart + (slotCount * SIZE_STORED));
// 20 byte SHA checksum at the top of the file, which covers all data that follows.
var hash = data[..sha1HashSize];