From c64ff5dd76b6eebf0e84cae7a804b07056ad3f8e Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 10 Jul 2019 00:19:59 -0700 Subject: [PATCH] Fix sav5 behavior Closes #2356 ty @Ammako --- PKHeX.Core/Saves/SaveFile.cs | 4 ++-- PKHeX.Core/Saves/Substructures/PokeDex/Zukan5.cs | 2 +- PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Pokedex5.cs | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PKHeX.Core/Saves/SaveFile.cs b/PKHeX.Core/Saves/SaveFile.cs index 7ba11f108..51a9ae3ae 100644 --- a/PKHeX.Core/Saves/SaveFile.cs +++ b/PKHeX.Core/Saves/SaveFile.cs @@ -92,8 +92,8 @@ namespace PKHeX.Core public bool ORASDEMO => Data.Length == SaveUtil.SIZE_G6ORASDEMO; public bool ORAS => Data.Length == SaveUtil.SIZE_G6ORAS; public bool XY => Data.Length == SaveUtil.SIZE_G6XY; - public bool B2W2 => Version == GameVersion.B2W2; - public bool BW => Version == GameVersion.BW; + public bool B2W2 => this is SAV5B2W2; + public bool BW => this is SAV5BW; public bool HGSS => Version == GameVersion.HGSS; public bool Pt => Version == GameVersion.Pt; public bool DP => Version == GameVersion.DP; diff --git a/PKHeX.Core/Saves/Substructures/PokeDex/Zukan5.cs b/PKHeX.Core/Saves/Substructures/PokeDex/Zukan5.cs index b30cc703b..dfa83d6c3 100644 --- a/PKHeX.Core/Saves/Substructures/PokeDex/Zukan5.cs +++ b/PKHeX.Core/Saves/Substructures/PokeDex/Zukan5.cs @@ -75,7 +75,7 @@ namespace PKHeX.Core private void SetCaughtFlag(int bit) => SetFlag(OFS_CAUGHT, bit); private int FormLen => SAV.B2W2 ? 0xB : 0x9; - private int FormDex => PokeDex + 0x8 + (BitSeenSize * 9); + private int FormDex => 0x8 + (BitSeenSize * 9); private void SetFormFlags(PKM pkm) { diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Pokedex5.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Pokedex5.cs index c646f67a1..cab246770 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Pokedex5.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen5/SAV_Pokedex5.cs @@ -180,15 +180,15 @@ namespace PKHeX.WinForms return; for (int i = 0; i < CLB_FormsSeen.Items.Count/2; i++) // Seen - Dex.SetFormFlag(f, 0, CLB_FormsSeen.GetItemChecked(i)); + Dex.SetFormFlag(f + i, 0, CLB_FormsSeen.GetItemChecked(i)); for (int i = 0; i < CLB_FormsSeen.Items.Count/2; i++) // Seen Shiny - Dex.SetFormFlag(f, 1, CLB_FormsSeen.GetItemChecked(i + (CLB_FormsSeen.Items.Count/2))); + Dex.SetFormFlag(f + i, 1, CLB_FormsSeen.GetItemChecked(i + (CLB_FormsSeen.Items.Count/2))); editing = true; for (int i = 0; i < CLB_FormDisplayed.Items.Count/2; i++) // Displayed - Dex.SetFormFlag(f, 2, CLB_FormDisplayed.GetItemChecked(i)); + Dex.SetFormFlag(f + i, 2, CLB_FormDisplayed.GetItemChecked(i)); for (int i = 0; i < CLB_FormDisplayed.Items.Count/2; i++) // Displayed Shiny - Dex.SetFormFlag(f, 3, CLB_FormDisplayed.GetItemChecked(i + (CLB_FormDisplayed.Items.Count/2))); + Dex.SetFormFlag(f + i, 3, CLB_FormDisplayed.GetItemChecked(i + (CLB_FormDisplayed.Items.Count/2))); editing = false; }