Error check on invalid legality

Check fails -> flag instead of error.
This commit is contained in:
Kaphotics
2016-06-29 22:59:20 -07:00
parent 8a8926bcca
commit 053657c3be

View File

@@ -26,10 +26,14 @@ public LegalityAnalysis(PKM pk)
if (!(pk is PK6))
return;
pk6 = pk as PK6;
updateRelearnLegality();
updateMoveLegality();
updateChecks();
getLegalityReport();
try
{
updateRelearnLegality();
updateMoveLegality();
updateChecks();
getLegalityReport();
}
catch { Valid = false; }
}
public void updateRelearnLegality()
@@ -109,7 +113,7 @@ private string getVerboseLegalityReport()
r += Environment.NewLine;
var chks = Checks;
r += chks.Where(chk => chk.Valid && chk.Comment != "Valid").OrderBy(chk => chk.Judgement) // Fishy sorted to top
r += chks.Where(chk => chk != null && chk.Valid && chk.Comment != "Valid").OrderBy(chk => chk.Judgement) // Fishy sorted to top
.Aggregate("", (current, chk) => current + $"{chk.Judgement}: {chk.Comment}{Environment.NewLine}");
return r.TrimEnd();
}