Bounds check sketch move IDs for generation

Smeargle no longer permitted to have Eerie Spell in gen6 format :)
This commit is contained in:
Kurt 2021-12-23 01:24:47 -08:00
parent 4e7e23cb88
commit 606818b835
2 changed files with 14 additions and 1 deletions

View file

@ -129,6 +129,19 @@ namespace PKHeX.Core
_ => -1,
};
internal static int GetMaxMoveID(int generation) => generation switch
{
1 => MaxMoveID_1,
2 => MaxMoveID_2,
3 => MaxMoveID_3,
4 => MaxMoveID_4,
5 => MaxMoveID_5,
6 => MaxMoveID_6_AO,
7 => MaxMoveID_7b,
8 => MaxMoveID_8,
_ => -1,
};
internal const GameVersion NONE = GameVersion.Invalid;
internal static readonly LearnVersion LearnNONE = new(-1);

View file

@ -129,7 +129,7 @@ namespace PKHeX.Core
return false;
if (generation is 8 && DummiedMoves_BDSP.Contains(move)) // can't Sketch unusable moves in BDSP
return false;
return true;
return move <= GetMaxMoveID(generation);
}
/// <summary>