From af0e05f6aff8aecae1e539f9d1285fa5c280d2b2 Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 6 Feb 2018 20:33:32 -0800 Subject: [PATCH] Fix sav editing from direct memcard saves Thanks @sora10pls for finding this (just use the existing MC data) --- PKHeX.Core/Saves/SAV3Colosseum.cs | 2 +- PKHeX.Core/Saves/SAV3XD.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Saves/SAV3Colosseum.cs b/PKHeX.Core/Saves/SAV3Colosseum.cs index 3ae9efdaa..92875a261 100644 --- a/PKHeX.Core/Saves/SAV3Colosseum.cs +++ b/PKHeX.Core/Saves/SAV3Colosseum.cs @@ -121,7 +121,7 @@ public override byte[] Write(bool DSV, bool GCI) byte[] newSAV = EncryptColosseum(Data, digest); // Put save slot back in original save data - byte[] newFile = (byte[])BAK.Clone(); + byte[] newFile = MC != null ? MC.SelectedSaveData : (byte[])BAK.Clone(); Array.Copy(newSAV, 0, newFile, SLOT_START + SaveIndex*SLOT_SIZE, newSAV.Length); // Return the gci if Memory Card is not being exported diff --git a/PKHeX.Core/Saves/SAV3XD.cs b/PKHeX.Core/Saves/SAV3XD.cs index 3c9aa50b7..301ab1a10 100644 --- a/PKHeX.Core/Saves/SAV3XD.cs +++ b/PKHeX.Core/Saves/SAV3XD.cs @@ -133,7 +133,7 @@ public override byte[] Write(bool DSV, bool GCI) byte[] newSAV = SaveUtil.EncryptGC(Data, 0x10, 0x27FD8, keys); // Put save slot back in original save data - byte[] newFile = (byte[])BAK.Clone(); + byte[] newFile = MC != null ? MC.SelectedSaveData : (byte[])BAK.Clone(); Array.Copy(newSAV, 0, newFile, SLOT_START + SaveIndex * SLOT_SIZE, newSAV.Length); // Return the gci if Memory Card is not being exported