Handle setting egg flag in cxd saves

No longer throws an exception due to EncounterInvalid having an invalid version ID (fails to fetch personal/learnset).
This commit is contained in:
Kurt 2023-08-29 22:47:07 -07:00
parent 978bcfa56f
commit 78e7536459
2 changed files with 2 additions and 2 deletions

View file

@ -27,7 +27,7 @@ public static class EncounterVerifier
EncounterStatic3 { Species: (int)Species.Deoxys, Location: 200 } when pk.Language == (int)LanguageID.Japanese => GetInvalid(LEncUnreleased),
EncounterStatic4 { Roaming: true } when pk is G4PKM { Met_Location: 193, GroundTile: GroundTileType.Water } => GetInvalid(LG4InvalidTileR45Surf),
MysteryGift g => VerifyEncounterEvent(pk, g),
{ EggEncounter: true } => VerifyEncounterEgg(pk, enc.Generation),
{ EggEncounter: true } when !pk.IsEgg => VerifyEncounterEgg(pk, enc.Generation),
EncounterInvalid => GetInvalid(LEncInvalid),
_ => GetValid(string.Empty), // todo: refactor
};

View file

@ -29,7 +29,7 @@ internal static class LearnVerifierEgg
{
VerifyMovesInitial(result, current, x);
}
else
else if (enc.Version is not (GameVersion.Any or >= GameVersion.Unknown))
{
var ls = GameData.GetLearnSource(enc.Version);
var learn = ls.GetLearnset(enc.Species, enc.Form);