mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
Hide unavailable species for PLA saves (similar to LGPE)
This commit is contained in:
parent
a3595d1429
commit
9137a03b50
2 changed files with 18 additions and 0 deletions
|
@ -46,6 +46,8 @@ namespace PKHeX.Core
|
|||
{
|
||||
SAV7b => source.SpeciesDataSource // LGPE: Kanto 151, Meltan/Melmetal
|
||||
.Where(s => s.Value is <= (int)Core.Species.Mew or (int)Core.Species.Meltan or (int)Core.Species.Melmetal),
|
||||
SAV8LA => source.SpeciesDataSource
|
||||
.Where(s => PersonalTable.LA.IsSpeciesInGame(s.Value)),
|
||||
_ => source.SpeciesDataSource.Where(s => s.Value <= sav.MaxSpeciesID),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -380,5 +380,21 @@ namespace PKHeX.Core
|
|||
{
|
||||
return Table.Any(p => p.IsValidTypeCombination(type1, type2));
|
||||
}
|
||||
|
||||
public bool IsSpeciesInGame(int species)
|
||||
{
|
||||
if ((uint)species > MaxSpeciesID)
|
||||
return false;
|
||||
var form0 = Table[species];
|
||||
if (form0.HP != 0)
|
||||
return true;
|
||||
var fc = form0.FormCount;
|
||||
for (int i = 1; i < fc; i++)
|
||||
{
|
||||
if (GetFormEntry(species, i).HP != 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue