handle hacked edge case input

gen7 pkm version on format5 -> exception on new int[-X]
normally caught via exception suppression but better to handle the
cause.
This commit is contained in:
Kurt 2017-11-15 18:13:04 -08:00
parent bd08d11597
commit 0cfb79a3e2

View file

@ -816,6 +816,8 @@ namespace PKHeX.Core
}
private static int[] GetGenMovesOrder(int start, int end)
{
if (start <= end)
return new[] {start};
var order = new int[start - end + 1];
for (int i = 0; i < order.Length; i++)
order[i] = start - i;