mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
Update SAV3GCMemoryCard.cs
Move SaveGameCount field reset outside of the loop. Closes #3682 ty @TheZett ! Make if-if-if an if-else since entry to one will never enter the others.
This commit is contained in:
parent
715391e3b0
commit
d4835392a0
1 changed files with 3 additions and 3 deletions
|
@ -223,6 +223,7 @@ public sealed class SAV3GCMemoryCard
|
||||||
: Directory_Block;
|
: Directory_Block;
|
||||||
|
|
||||||
// Search for pokemon savegames in the directory
|
// Search for pokemon savegames in the directory
|
||||||
|
SaveGameCount = 0;
|
||||||
for (int i = 0; i < NumEntries_Directory; i++)
|
for (int i = 0; i < NumEntries_Directory; i++)
|
||||||
{
|
{
|
||||||
int offset = (DirectoryBlock_Used * BLOCK_SIZE) + (i * DENTRY_SIZE);
|
int offset = (DirectoryBlock_Used * BLOCK_SIZE) + (i * DENTRY_SIZE);
|
||||||
|
@ -240,7 +241,6 @@ public sealed class SAV3GCMemoryCard
|
||||||
if (dataEnd > Data.Length)
|
if (dataEnd > Data.Length)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SaveGameCount = 0;
|
|
||||||
var header = Data.AsSpan(offset, 4);
|
var header = Data.AsSpan(offset, 4);
|
||||||
var ver = SaveHandlerGCI.GetGameCode(header);
|
var ver = SaveHandlerGCI.GetGameCode(header);
|
||||||
if (ver == GameVersion.COLO)
|
if (ver == GameVersion.COLO)
|
||||||
|
@ -250,14 +250,14 @@ public sealed class SAV3GCMemoryCard
|
||||||
EntryCOLO = i;
|
EntryCOLO = i;
|
||||||
SaveGameCount++;
|
SaveGameCount++;
|
||||||
}
|
}
|
||||||
if (ver == GameVersion.XD)
|
else if (ver == GameVersion.XD)
|
||||||
{
|
{
|
||||||
if (HasXD) // another entry already exists
|
if (HasXD) // another entry already exists
|
||||||
return GCMemoryCardState.DuplicateXD;
|
return GCMemoryCardState.DuplicateXD;
|
||||||
EntryXD = i;
|
EntryXD = i;
|
||||||
SaveGameCount++;
|
SaveGameCount++;
|
||||||
}
|
}
|
||||||
if (ver == GameVersion.RSBOX)
|
else if (ver == GameVersion.RSBOX)
|
||||||
{
|
{
|
||||||
if (HasRSBOX) // another entry already exists
|
if (HasRSBOX) // another entry already exists
|
||||||
return GCMemoryCardState.DuplicateRSBOX;
|
return GCMemoryCardState.DuplicateRSBOX;
|
||||||
|
|
Loading…
Add table
Reference in a new issue