mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +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.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using static PKHeX.Core.Ball;
|
using static PKHeX.Core.Ball;
|
||||||
|
@ -23,7 +23,10 @@ public static class BallApplicator
|
||||||
var clone = pk.Clone();
|
var clone = pk.Clone();
|
||||||
foreach (var b in BallList)
|
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)
|
if (new LegalityAnalysis(clone).Valid)
|
||||||
yield return b;
|
yield return b;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue