mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Ensure cleared move pkms have at least 1 move
#1214 user may not be checking legality (bulk transfer)
This commit is contained in:
parent
d19b83000d
commit
991978dab6
2 changed files with 6 additions and 4 deletions
|
@ -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();
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue