From 14225bbc2e9f82f9a2fc14063e51c3865dbdd904 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 4 Jun 2017 00:12:35 -0700 Subject: [PATCH] misc fixes encounterinvalid isegg no longer throws exceptions when parsing moves dropping invalid file paths to main window are now ignored (downloads from chrome can be manually deleted but still dragged from the downloads bar) add pidiv case for manaphy gift --- PKHeX.Core/Legality/Encounters/VerifyCurrentMoves.cs | 4 ++-- PKHeX.Core/Legality/RNG/MethodFinder.cs | 2 ++ PKHeX.WinForms/MainWindow/Main.cs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/VerifyCurrentMoves.cs b/PKHeX.Core/Legality/Encounters/VerifyCurrentMoves.cs index 5b6ff4b54..47a1034a1 100644 --- a/PKHeX.Core/Legality/Encounters/VerifyCurrentMoves.cs +++ b/PKHeX.Core/Legality/Encounters/VerifyCurrentMoves.cs @@ -128,12 +128,12 @@ private static CheckResult[] parseMoves3DS(PKM pkm, GameVersion game, int[] Move } private static CheckResult[] parseMovesPre3DS(PKM pkm, int[] Moves, LegalInfo info) { - if (pkm.IsEgg) + if (pkm.IsEgg && info.EncounterMatch is EncounterEgg egg) { int[] SpecialMoves = (info.EncounterMatch as IMoveset)?.Moves; // Gift do not have special moves but also should not have normal egg moves var allowinherited = SpecialMoves == null && !pkm.WasGiftEgg && pkm.Species != 489 && pkm.Species != 490; - return parseMovesIsEggPreRelearn(pkm, Moves, SpecialMoves ?? new int[0], allowinherited, info.EncounterMatch as EncounterEgg); + return parseMovesIsEggPreRelearn(pkm, Moves, SpecialMoves ?? new int[0], allowinherited, egg); } if (pkm.GenNumber <= 2 && (info.EncounterMatch as IGeneration)?.Generation == 1) return parseMovesGen1(pkm, Moves, info); diff --git a/PKHeX.Core/Legality/RNG/MethodFinder.cs b/PKHeX.Core/Legality/RNG/MethodFinder.cs index c6c9aa18e..a7df8304a 100644 --- a/PKHeX.Core/Legality/RNG/MethodFinder.cs +++ b/PKHeX.Core/Legality/RNG/MethodFinder.cs @@ -542,6 +542,8 @@ public static bool IsCompatible4(this PIDType val, IEncounterable encounter) return s.Shiny == true ? val == PIDType.ChainShiny : val == PIDType.Method_1; case EncounterSlot _: return val == PIDType.Method_1; + case PGT g: // manaphy + return val == PIDType.Method_1 || val == PIDType.None; // regular && antishiny default: return val == PIDType.None; } diff --git a/PKHeX.WinForms/MainWindow/Main.cs b/PKHeX.WinForms/MainWindow/Main.cs index fb8aa2c62..ae26a1d26 100644 --- a/PKHeX.WinForms/MainWindow/Main.cs +++ b/PKHeX.WinForms/MainWindow/Main.cs @@ -460,6 +460,8 @@ private void OpenQuick(string path, bool force = false) string ext = Path.GetExtension(path); FileInfo fi = new FileInfo(path); + if (!fi.Exists) + return; if (fi.Length > 0x10009C && fi.Length != 0x380000 && ! SAV3GCMemoryCard.IsMemoryCardSize(fi.Length)) WinFormsUtil.Error("Input file is too large." + Environment.NewLine + $"Size: {fi.Length} bytes", path); else if (fi.Length < 32)