mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-13 22:15:20 -05:00
Error check on invalid legality
Check fails -> flag instead of error.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user