mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Fix ball enumerating when setter guards value
Ty Atrius!
This commit is contained in:
parent
8b0e93b42f
commit
66f43291d3
1 changed files with 5 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static PKHeX.Core.Ball;
|
||||
|
@ -23,7 +23,10 @@ public static class BallApplicator
|
|||
var clone = pk.Clone();
|
||||
foreach (var b in BallList)
|
||||
{
|
||||
clone.Ball = (int)b;
|
||||
var ball = (int)b;
|
||||
clone.Ball = ball;
|
||||
if (clone.Ball != ball)
|
||||
continue; // Some setters guard against out of bounds values.
|
||||
if (new LegalityAnalysis(clone).Valid)
|
||||
yield return b;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue