From 3b84f337764bd49ff5b200495ec27d600ec16675 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 10 Jun 2018 00:26:33 -0700 Subject: [PATCH] Misc changes Revert linq chain Closes #1987 change encountermatch comparison (never null), add comparison for vc output remove unused strings (will get removed from translation files in later update) --- PKHeX.Core/Legality/Analysis.cs | 2 ++ PKHeX.Core/Legality/Checks.cs | 2 +- .../Encounters/Verifiers/VerifyRelearnMoves.cs | 2 +- PKHeX.Core/Util/MessageStrings.cs | 2 -- .../Generation 6/236 - Tyrogue - 88A5A8BF7345.pk6 | Bin 0 -> 232 bytes .../357 ★ - Walker Mower - 0272CF40335F.pk6 | Bin 0 -> 232 bytes 6 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 Tests/PKHeX.Tests/Legality/Legal/Generation 6/236 - Tyrogue - 88A5A8BF7345.pk6 create mode 100644 Tests/PKHeX.Tests/Legality/Legal/Generation 6/357 ★ - Walker Mower - 0272CF40335F.pk6 diff --git a/PKHeX.Core/Legality/Analysis.cs b/PKHeX.Core/Legality/Analysis.cs index 7c85cb143..3c014408f 100644 --- a/PKHeX.Core/Legality/Analysis.cs +++ b/PKHeX.Core/Legality/Analysis.cs @@ -184,6 +184,8 @@ private void ParsePK7() private void UpdateVCTransferInfo() { EncounterOriginalGB = EncounterMatch; + if (EncounterOriginalGB is EncounterInvalid) + return; Info.EncounterMatch = EncounterStaticGenerator.GetVCStaticTransferEncounter(pkm); if (!(Info.EncounterMatch is EncounterStatic s) || !EncounterStaticGenerator.IsVCStaticTransferEncounterValid(pkm, s)) { AddLine(Severity.Invalid, V80, CheckIdentifier.Encounter); return; } diff --git a/PKHeX.Core/Legality/Checks.cs b/PKHeX.Core/Legality/Checks.cs index cce7847ba..261b9e2cf 100644 --- a/PKHeX.Core/Legality/Checks.cs +++ b/PKHeX.Core/Legality/Checks.cs @@ -871,7 +871,7 @@ private void VerifyTransferLegalityG4() private static IEnumerable VerifyVCEncounter(PKM pkm, IEncounterable encounter, ILocation transfer, IList Moves) { // Check existing EncounterMatch - if (encounter == null || transfer == null) + if (encounter is EncounterInvalid || transfer == null) yield break; // Avoid duplicate invaild message if (encounter is EncounterStatic v && (GameVersion.GBCartEraOnly.Contains(v.Version) || v.Version == GameVersion.VCEvents)) diff --git a/PKHeX.Core/Legality/Encounters/Verifiers/VerifyRelearnMoves.cs b/PKHeX.Core/Legality/Encounters/Verifiers/VerifyRelearnMoves.cs index e9e216bbd..dcdb91c4a 100644 --- a/PKHeX.Core/Legality/Encounters/Verifiers/VerifyRelearnMoves.cs +++ b/PKHeX.Core/Legality/Encounters/Verifiers/VerifyRelearnMoves.cs @@ -171,7 +171,7 @@ private static void FlagSplitbreedMoves(CheckResult[] res, int required, Encount private static int GetRequiredBaseMoves(int[] RelearnMoves, IReadOnlyList baseMoves, int baseCt, IReadOnlyList inheritMoves) { - var inherited = RelearnMoves.Where(m => m != 0).Except(baseMoves).Intersect(inheritMoves).ToList(); + var inherited = RelearnMoves.Where(m => m != 0 && (!baseMoves.Contains(m) || inheritMoves.Contains(m))).ToList(); int inheritCt = inherited.Count; // Get required amount of base moves diff --git a/PKHeX.Core/Util/MessageStrings.cs b/PKHeX.Core/Util/MessageStrings.cs index bcbbc4c0e..7e96d6c00 100644 --- a/PKHeX.Core/Util/MessageStrings.cs +++ b/PKHeX.Core/Util/MessageStrings.cs @@ -173,8 +173,6 @@ public static class MessageStrings public static string MsgSaveSwitchDaycareView { get; set; } = "Would you like to switch the view to the other Daycare?"; public static string MsgSaveSwitchDaycareCurrent { get; set; } = "Currently viewing daycare {0}."; - public static string MsgSaveGen6OPower { get; set; } = "No editing support for ORAS :("; - public static string MsgSaveGen6OPowerCheatDesc { get; set; } = "Max O-Powers with a working code?"; public static string MsgSaveGen6Passerby { get; set; } = "Export Passerby Info to Clipboard?"; public static string MsgSaveGen6FriendSafari { get; set; } = "No editing support for Friend Safari :("; public static string MsgSaveGen6FriendSafariCheatDesc { get; set; } = "Unlock all 3 slots for each friend?"; diff --git a/Tests/PKHeX.Tests/Legality/Legal/Generation 6/236 - Tyrogue - 88A5A8BF7345.pk6 b/Tests/PKHeX.Tests/Legality/Legal/Generation 6/236 - Tyrogue - 88A5A8BF7345.pk6 new file mode 100644 index 0000000000000000000000000000000000000000..534046cba89c65760762121b13f99d3a4c09f944 GIT binary patch literal 232 zcmZ=Q-oJu@VQI%31_p+o2UCD-1_nDu28Lblir;g9IB;P18O}svgfLVx6fxv8q%)K< zq#}tkFdSsq&ajA)k5NNTP6Q+Y<1;Y)`v2eF38*@UArnOhl*7p6k1XuQz{tYQpa&K5 xVn}32X2@m;W+(x&ihwK_sAFK(XJ8N);F1;K=3+>CWyi?E$RO>{#KZ(r0RS^DA7%gm literal 0 HcmV?d00001 diff --git a/Tests/PKHeX.Tests/Legality/Legal/Generation 6/357 ★ - Walker Mower - 0272CF40335F.pk6 b/Tests/PKHeX.Tests/Legality/Legal/Generation 6/357 ★ - Walker Mower - 0272CF40335F.pk6 new file mode 100644 index 0000000000000000000000000000000000000000..a25955639f1076f82a603d04052c1f8cbfae012b GIT binary patch literal 232 zcmazyb~w+#P{fqV$iVQ7Lob8@2$X>AnWizBTp$h{*uq)JjBtiTh8%`$hE#?k1_cIR zhJ1!{Fq?tFi@}@WHN#d$5lL27kPaB1f#Lt(|NFxkiWw@94MJiw`6F={+!z>HIN$& literal 0 HcmV?d00001