From f753816cb70e5a04b1fbbbe2d33db19ca26ffbf8 Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Sun, 11 Sep 2016 15:14:42 -0700 Subject: [PATCH] Fix gen2 met location Wasn't being loaded, the last loaded save file locations persisted. Load gen2 locations when loading a gen2 save file. Closes #262 --- PKHeX/MainWindow/Main.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PKHeX/MainWindow/Main.cs b/PKHeX/MainWindow/Main.cs index 333cf7d4d..6d3daf63a 100644 --- a/PKHeX/MainWindow/Main.cs +++ b/PKHeX/MainWindow/Main.cs @@ -1045,6 +1045,10 @@ private void loadSAV(SaveFile sav, string path) CB_ExtraBytes.SelectedIndex = 0; } + // pk2 save files do not have an Origin Game stored. Prompt the met location list to update. + if (SAV.Generation == 2) + updateOriginGame(null, null); + // Refresh PK#->PK6 conversion info PKMConverter.updateConfig(SAV.SubRegion, SAV.Country, SAV.ConsoleRegion, SAV.OT, SAV.Gender); @@ -2142,8 +2146,11 @@ private void updateSpecies(object sender, EventArgs e) updateLegality(); } - private List getLocationList(GameVersion Version, int SaveFormat, bool egg) + private static List getLocationList(GameVersion Version, int SaveFormat, bool egg) { + if (SaveFormat == 2) + return metGen2; + if (egg) { if (Version < GameVersion.W && SaveFormat >= 5) @@ -2152,13 +2159,6 @@ private List getLocationList(GameVersion Version, int SaveFormat, boo switch (Version) { - case GameVersion.GSC: - case GameVersion.GS: - case GameVersion.C: - if (SaveFormat == 2) - return metGen2; - break; - case GameVersion.CXD: if (SaveFormat == 3) return metGen3;