mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
Add maxspecies checks for gen7
accesses arrays outside the range for the new USUM species Closes #1631 , add test case also adds lycanroc test cases for #1630
This commit is contained in:
parent
6b281cbefe
commit
5859daf1d8
5 changed files with 8 additions and 0 deletions
|
@ -372,6 +372,8 @@ namespace PKHeX.Core
|
|||
case GameVersion.MN:
|
||||
case GameVersion.SM:
|
||||
{
|
||||
if (species > MaxSpeciesID_7)
|
||||
break;
|
||||
int index = PersonalTable.SM.GetFormeIndex(species, form);
|
||||
r.AddRange(LevelUpSM[index].GetMoves(lvl));
|
||||
if (ver == GameVersion.Any) // Fall Through
|
||||
|
@ -550,6 +552,8 @@ namespace PKHeX.Core
|
|||
case GameVersion.SN:
|
||||
case GameVersion.MN:
|
||||
case GameVersion.SM:
|
||||
if (species > MaxSpeciesID_7)
|
||||
break;
|
||||
if (pkm.InhabitedGeneration(7))
|
||||
{
|
||||
int index = PersonalTable.SM.GetFormeIndex(species, pkm.AltForm);
|
||||
|
@ -1603,6 +1607,8 @@ namespace PKHeX.Core
|
|||
return getMoves(LevelUpAO, PersonalTable.AO);
|
||||
|
||||
case GameVersion.SN: case GameVersion.MN:
|
||||
if (species > MaxSpeciesID_7)
|
||||
break;
|
||||
return getMoves(LevelUpSM, PersonalTable.SM);
|
||||
case GameVersion.US: case GameVersion.UM:
|
||||
return getMoves(LevelUpUSUM, PersonalTable.USUM);
|
||||
|
@ -1934,6 +1940,8 @@ namespace PKHeX.Core
|
|||
case GameVersion.Any:
|
||||
case GameVersion.SN: case GameVersion.MN: case GameVersion.SM:
|
||||
{
|
||||
if (species > MaxSpeciesID_7)
|
||||
break;
|
||||
int index = PersonalTable.SM.GetFormeIndex(species, form);
|
||||
if (MoveReminder)
|
||||
lvl = 100; // Move reminder can teach any level in movepool now!
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue