mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-26 22:10:21 +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;
|
||||
|
||||
// Search for pokemon savegames in the directory
|
||||
SaveGameCount = 0;
|
||||
for (int i = 0; i < NumEntries_Directory; i++)
|
||||
{
|
||||
int offset = (DirectoryBlock_Used * BLOCK_SIZE) + (i * DENTRY_SIZE);
|
||||
|
@ -240,7 +241,6 @@ public sealed class SAV3GCMemoryCard
|
|||
if (dataEnd > Data.Length)
|
||||
continue;
|
||||
|
||||
SaveGameCount = 0;
|
||||
var header = Data.AsSpan(offset, 4);
|
||||
var ver = SaveHandlerGCI.GetGameCode(header);
|
||||
if (ver == GameVersion.COLO)
|
||||
|
@ -250,14 +250,14 @@ public sealed class SAV3GCMemoryCard
|
|||
EntryCOLO = i;
|
||||
SaveGameCount++;
|
||||
}
|
||||
if (ver == GameVersion.XD)
|
||||
else if (ver == GameVersion.XD)
|
||||
{
|
||||
if (HasXD) // another entry already exists
|
||||
return GCMemoryCardState.DuplicateXD;
|
||||
EntryXD = i;
|
||||
SaveGameCount++;
|
||||
}
|
||||
if (ver == GameVersion.RSBOX)
|
||||
else if (ver == GameVersion.RSBOX)
|
||||
{
|
||||
if (HasRSBOX) // another entry already exists
|
||||
return GCMemoryCardState.DuplicateRSBOX;
|
||||
|
|
Loading…
Reference in a new issue