mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-09 04:24:36 -05:00
Cast the array a little safer
bad hacks with invalid future gen evolutions yield no evolution data, which results in empty arrays.
This commit is contained in:
parent
06522c2235
commit
3111a8dc62
|
|
@ -21,8 +21,8 @@ public ValidEncounterMoves(PKM pkm, LevelUpRestriction restrict, IEncounterable
|
|||
{
|
||||
var level = Legal.GetValidMovesAllGens(pkm, restrict.EvolutionChains, minLvLG1: restrict.MinimumLevelGen1, minLvLG2: restrict.MinimumLevelGen2, Tutor: false, Machine: false, RemoveTransferHM: false);
|
||||
|
||||
if (encounter is IGeneration g)
|
||||
AddEdgeCaseMoves((List<int>)level[g.Generation], encounter, pkm);
|
||||
if (encounter is IGeneration g && level[g.Generation] is List<int> x)
|
||||
AddEdgeCaseMoves(x, encounter, pkm);
|
||||
|
||||
LevelUpMoves = level;
|
||||
TMHMMoves = Legal.GetValidMovesAllGens(pkm, restrict.EvolutionChains, LVL: false, Tutor: false, MoveReminder: false, RemoveTransferHM: false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user