diff --git a/PKHeX.Core/Legality/Encounters/Generator/EncounterSlotGenerator.cs b/PKHeX.Core/Legality/Encounters/Generator/EncounterSlotGenerator.cs index 9a193f22f..ec1df8d43 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/EncounterSlotGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/EncounterSlotGenerator.cs @@ -121,7 +121,7 @@ private static bool IsDeferred(this EncounterSlot slot, int currentSpecies, PKM public static IEnumerable GetValidFriendSafari(PKM pkm) { - if (!pkm.XY || pkm.Met_Location != 148 || pkm.Met_Level != 30) // Friend Safari + if (!pkm.XY || pkm.Met_Location != 148 || pkm.Met_Level != 30 || pkm.Egg_Location != 0) // Friend Safari return Enumerable.Empty(); var vs = EvolutionChain.GetValidPreEvolutions(pkm).Where(d => d.Level >= 30); return vs.SelectMany(z => Encounters6.FriendSafari[z.Species]); @@ -129,7 +129,7 @@ public static IEnumerable GetValidFriendSafari(PKM pkm) private static IEnumerable GetValidEncounterSlots(PKM pkm, EncounterArea loc, IEnumerable vs, bool DexNav = false, int lvl = -1, bool ignoreLevel = false) { - if (pkm.WasEgg) + if (pkm.Egg_Location != 0) return Enumerable.Empty(); if (lvl < 0) lvl = GetMinLevelEncounter(pkm); diff --git a/PKHeX.Core/Legality/Verifiers/CXDVerifier.cs b/PKHeX.Core/Legality/Verifiers/CXDVerifier.cs index 987daa1cc..e01114551 100644 --- a/PKHeX.Core/Legality/Verifiers/CXDVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/CXDVerifier.cs @@ -13,7 +13,7 @@ public override void Verify(LegalityAnalysis data) var pkm = data.pkm; if (data.EncounterMatch is EncounterStatic) VerifyCXDStarterCorrelation(data); - else if (pkm.WasEgg) // can't obtain eggs in CXD + else if (pkm.Egg_Location != 0) // can't obtain eggs in CXD data.AddLine(GetInvalid(V80, CheckIdentifier.Encounter)); // invalid encounter if (pkm.OT_Gender == 1) diff --git a/PKHeX.Core/Legality/Verifiers/EncounterTypeVerifier.cs b/PKHeX.Core/Legality/Verifiers/EncounterTypeVerifier.cs index 70d579384..3e73a0ba5 100644 --- a/PKHeX.Core/Legality/Verifiers/EncounterTypeVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/EncounterTypeVerifier.cs @@ -20,7 +20,7 @@ private static EncounterType GetEncounterTypeValue(PKM pkm, IEncounterable enc) { // Encounter type data is only stored for gen 4 encounters // All eggs have encounter type none, even if they are from static encounters - if (!pkm.Gen4 || pkm.WasEgg) + if (!pkm.Gen4 || pkm.Egg_Location != 0) return EncounterType.None; if (enc is EncounterSlot w) diff --git a/PKHeX.Core/Util/Util.cs b/PKHeX.Core/Util/Util.cs index e5f56c36d..b1ca6d8d8 100644 --- a/PKHeX.Core/Util/Util.cs +++ b/PKHeX.Core/Util/Util.cs @@ -24,7 +24,7 @@ public static uint GetHexValue(string s) } private static bool IsHex(char c) => (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); - private static string TitleCase(string word) => word[0].ToString().ToUpper() + word.Substring(1, word.Length - 1).ToLower(); + private static string TitleCase(string word) => char.ToUpper(word[0]) + word.Substring(1, word.Length - 1).ToLower(); /// /// Filters the string down to only valid hex characters, returning a new string. diff --git a/Tests/PKHeX.Tests/Legality/Illegal/Wild/132 - Ditto - 5CD1D273663D.pk6 b/Tests/PKHeX.Tests/Legality/Illegal/Wild/132 - Ditto - 5CD1D273663D.pk6 new file mode 100644 index 000000000..100674a3f Binary files /dev/null and b/Tests/PKHeX.Tests/Legality/Illegal/Wild/132 - Ditto - 5CD1D273663D.pk6 differ diff --git a/Tests/PKHeX.Tests/Legality/Illegal/Wild/213 - Shuckle - 55FB411103A3.pk6 b/Tests/PKHeX.Tests/Legality/Illegal/Wild/213 - Shuckle - 55FB411103A3.pk6 new file mode 100644 index 000000000..bda15c1d9 Binary files /dev/null and b/Tests/PKHeX.Tests/Legality/Illegal/Wild/213 - Shuckle - 55FB411103A3.pk6 differ diff --git a/Tests/PKHeX.Tests/Legality/Illegal/Wild/706_-_Goodra_-_971B6773DCC2.pk7 b/Tests/PKHeX.Tests/Legality/Illegal/Wild/706_-_Goodra_-_971B6773DCC2.pk7 new file mode 100644 index 000000000..154904c6d Binary files /dev/null and b/Tests/PKHeX.Tests/Legality/Illegal/Wild/706_-_Goodra_-_971B6773DCC2.pk7 differ