Ensure cleared move pkms have at least 1 move

#1214
user may not be checking legality (bulk transfer)
This commit is contained in:
Kurt 2017-06-10 08:39:04 -07:00
parent d19b83000d
commit 991978dab6
2 changed files with 6 additions and 4 deletions

View file

@ -913,6 +913,11 @@ namespace PKHeX.Core
}
if (invalid == 0)
return;
if (invalid == 4) // no moves remain
{
moves[0] = 1; // Pound
Move1_PP = getMovePP(1, Move1_PPUps);
}
Moves = moves;
FixMoves();

View file

@ -1076,10 +1076,7 @@ namespace PKHeX.Core
if (pk.OT_Name.Length > SAV.OTLength)
pk.OT_Name = pk.OT_Name.Substring(0, SAV.OTLength);
if (pk.Moves.Any(move => move > SAV.MaxMoveID))
{
pk.Moves = pk.Moves.Select(move => move <= SAV.MaxMoveID ? move : 0).ToArray();
pk.FixMoves();
}
pk.ClearInvalidMoves();
if (pk.EVs.Any(ev => ev > SAV.MaxEV))
pk.EVs = pk.EVs.Select(ev => Math.Min(SAV.MaxEV, ev)).ToArray();
if (pk.IVs.Any(ev => ev > SAV.MaxEV))