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:
Kaphotics
2016-04-30 14:23:56 -07:00
parent 7a94640c0c
commit eb5c753db0

View File

@@ -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++)