From 225302c1499169fd705950a78c670c84dbd72b2e Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 5 Apr 2015 10:48:18 -0700 Subject: [PATCH] Double hotfix! Wondercards with unknown items (null -> load unknown); block Eon Ticket Fix language auto-loading --- PKX/f1-Main.cs | 5 ++--- Resources/text/changelog.txt | 5 ++++- SAV/SAV_Wondercard.cs | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/PKX/f1-Main.cs b/PKX/f1-Main.cs index 9d822bb5a..8c36795dc 100644 --- a/PKX/f1-Main.cs +++ b/PKX/f1-Main.cs @@ -41,12 +41,11 @@ namespace PKHeX CB_MainLanguage.Items.Add(cbItem); // Try and detect the language - int[] main_langnum = {2, 1, 3, 4, 5, 7, 8, 9}; + int[] main_langnum = {1, 2, 3, 4, 5, 7, 8, 9}; main_langnum = main_langnum.Concat(Enumerable.Range(10, lang_val.Length).Select(i => i).ToArray()).ToArray(); string filename = Path.GetFileNameWithoutExtension(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName); string lastTwoChars = filename.Substring(filename.Length - 2); - int lang = Array.IndexOf(main_langnum, Array.IndexOf(lang_val, lastTwoChars)); - + int lang = Array.IndexOf(lang_val, lastTwoChars); CB_MainLanguage.SelectedIndex = lang >= 0 ? main_langnum[lang] - 1 : ((lastTwoChars == "jp") ? 1 : 0); #region HaX diff --git a/Resources/text/changelog.txt b/Resources/text/changelog.txt index 1954c07c3..ea070df37 100644 --- a/Resources/text/changelog.txt +++ b/Resources/text/changelog.txt @@ -529,4 +529,7 @@ http://projectpokemon.org/forums/showthread.php?36986 - Fixed: Vivillon Form selection in the Trainer Info editor will now function with refactored code. Thanks KingGengar & Favna! - Fixed: New PKRS capping code will now behave properly. Thanks Favna and evandixon! - Changed: PKRS Days capped at legal limits. - - Changed: Forms drop-down and label will be hidden if a Pokémon has no forms. \ No newline at end of file + - Changed: Forms drop-down and label will be hidden if a Pokémon has no forms. + - Hotfix: Changing the exe name to auto-load a language will now function properly. Thanks supercarotte! + - Hotfix: Wondercard QRs with non-held items will no longer error out. Thanks ShinyMeganium! + - Hotfix: Prevented export of Eon Ticket Wondercards via QR because extra data has to be altered in order for it to function. \ No newline at end of file diff --git a/SAV/SAV_Wondercard.cs b/SAV/SAV_Wondercard.cs index 885fc0238..5b17a4d0c 100644 --- a/SAV/SAV_Wondercard.cs +++ b/SAV/SAV_Wondercard.cs @@ -316,7 +316,7 @@ namespace PKHeX } break; case 1: - img = (Image)Properties.Resources.ResourceManager.GetObject("item_" + BitConverter.ToUInt16(data, 0x68)); + img = (Image)(Properties.Resources.ResourceManager.GetObject("item_" + BitConverter.ToUInt16(data, 0x68)) ?? Properties.Resources.unknown); break; default: img = Properties.Resources.unknown; @@ -342,6 +342,8 @@ namespace PKHeX { if (wondercard_data.SequenceEqual((new byte[wondercard_data.Length]))) { Util.Alert("No wondercard data found"); return; } + if (BitConverter.ToUInt16(wondercard_data, 0x68) == 726 && wondercard_data[0x51] == 1) + { Util.Alert("Eon Ticket Wondercards will not function properly", "Inject to the save file instead."); return; } // Prep data byte[] wcdata = wondercard_data; // Ensure size