From 644fa4e9294459a96066c9e3e25b7493b5dcf97f Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 14 Nov 2018 22:20:59 -0800 Subject: [PATCH] Call slot compression Doesn't work correctly (data shifted down still persists) --- PKHeX.Core/Saves/Substructures/Gen7/PokeListHeader.cs | 2 +- PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/PKHeX.Core/Saves/Substructures/Gen7/PokeListHeader.cs b/PKHeX.Core/Saves/Substructures/Gen7/PokeListHeader.cs index f6580881f..5365cad2d 100644 --- a/PKHeX.Core/Saves/Substructures/Gen7/PokeListHeader.cs +++ b/PKHeX.Core/Saves/Substructures/Gen7/PokeListHeader.cs @@ -79,7 +79,7 @@ public int FollowerIndex get => PokeListInfo[FOLLOW]; set { - if ((ushort)value > 1000) + if ((ushort)value > 1000 && value != SLOT_EMPTY) throw new ArgumentException(nameof(value)); PokeListInfo[FOLLOW] = (ushort)value; } diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs index 5c4e01e55..f815eb417 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs @@ -716,6 +716,9 @@ private static bool IsFolderPath(out string path) public bool ExportSaveFile() { ValidateChildren(); + bool reload = SAV is SAV7b b && b.FixPreWrite(); + if (reload) + ReloadSlots(); return WinFormsUtil.SaveSAVDialog(SAV, SAV.CurrentBox); }