Recognize unhatched crystal eggs, 2F pokecenter location

lacking met location data on receipt, can result in 0 for eggs hatched on the second floor of a pokecenter

https://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_index_number_(Generation_II)

Thanks Freezing Dart!
This commit is contained in:
Kurt 2021-10-19 21:53:22 -07:00
parent 93d5f0886a
commit 256b3c66ca
3 changed files with 6 additions and 4 deletions

View file

@ -44,8 +44,8 @@ namespace PKHeX.Core
{
case 0 when pkm.Met_Location != 0:
return false;
case 1 when pkm.Met_Location == 0:
return false;
case 1: // 0 = second floor of every Pokémon Center, valid
return true;
default:
if (pkm.Met_Location == 0 && pkm.Met_Level != 0)
return false;

View file

@ -53,7 +53,9 @@ namespace PKHeX.Core
// Check if the met data is present or could have been erased.
if (pkm.Format > 2)
return true; // doesn't have original met location
if (pkm.Met_Location != 0)
if (pkm.IsEgg)
return true; // doesn't have location yet
if (pkm.Met_Level == 1) // Met location of 0 is valid -- second floor of every Pokémon Center
return true; // has original met location
if (species < Legal.MaxSpeciesID_1)
return true; // can trade RBY to wipe location

View file

@ -122,7 +122,7 @@ namespace PKHeX.Core
if (pkm.OT_Gender == 1)
{
if ((pkm.Format == 2 && pkm.Met_Location == 0) || (pkm.Format > 2 && pkm.VC1) || data is {EncounterOriginal: {Generation:1} or EncounterStatic2E {IsGift:true}})
if (pkm is ICaughtData2 {CaughtData:0} || (pkm.Format > 2 && pkm.VC1) || data is {EncounterOriginal: {Generation:1} or EncounterStatic2E {IsGift:true}})
data.AddLine(GetInvalid(LG1OTGender));
}
}