mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-02 05:09:01 -05:00
Fix iterator for wc6 checking relearn
The .Remove was tampering with the same variable that the foreach was iterating over, causing exceptions. By casting to a WC6[], the List<WC6> can be altered and the array is iterated over instead.
This commit is contained in:
@@ -776,7 +776,7 @@ private LegalityCheck[] verifyRelearn()
|
||||
{
|
||||
// Get WC6's that match
|
||||
CardMatch = new List<WC6>(Legal.getValidWC6s(pk6));
|
||||
foreach (var wc in CardMatch)
|
||||
foreach (var wc in CardMatch.ToArray())
|
||||
{
|
||||
int[] moves = wc.RelearnMoves;
|
||||
for (int i = 0; i < 4; i++)
|
||||
|
||||
Reference in New Issue
Block a user