mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-01 11:06:50 -05:00
Flag unparsed pkms
With every format now supported, can flag GameVersion=0 pkm
This commit is contained in:
@@ -40,7 +40,7 @@ private IEnumerable<int> AllSuggestedMoves
|
||||
if (Error)
|
||||
return new int[4];
|
||||
if (_allSuggestedMoves == null)
|
||||
return _allSuggestedMoves = !pkm.IsOriginValid ? new int[4] : getSuggestedMoves(true, true, true);
|
||||
return _allSuggestedMoves = pkm == null || !pkm.IsOriginValid ? new int[4] : getSuggestedMoves(true, true, true);
|
||||
return _allSuggestedMoves;
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ private IEnumerable<int> AllSuggestedRelearnMoves
|
||||
if (Error)
|
||||
return new int[4];
|
||||
if (_allSuggestedRelearnMoves == null)
|
||||
return _allSuggestedRelearnMoves = !pkm.IsOriginValid ? new int[4] : Legal.getValidRelearn(pkm, -1).ToArray();
|
||||
return _allSuggestedRelearnMoves = pkm == null || !pkm.IsOriginValid ? new int[4] : Legal.getValidRelearn(pkm, -1).ToArray();
|
||||
return _allSuggestedRelearnMoves;
|
||||
}
|
||||
}
|
||||
@@ -86,8 +86,7 @@ public LegalityAnalysis(PKM pk)
|
||||
case 7: parsePK7(pk); break;
|
||||
}
|
||||
|
||||
Valid = Parsed = Parse.Any();
|
||||
if (Parsed)
|
||||
if (Parse.Count > 0)
|
||||
{
|
||||
if (Parse.Any(chk => !chk.Valid))
|
||||
Valid = false;
|
||||
@@ -95,6 +94,8 @@ public LegalityAnalysis(PKM pk)
|
||||
Valid = false;
|
||||
else if (vRelearn.Any(m => m.Valid != true))
|
||||
Valid = false;
|
||||
else
|
||||
Valid = true;
|
||||
|
||||
if (pkm.FatefulEncounter && vRelearn.Any(chk => !chk.Valid) && EncounterMatch == null)
|
||||
AddLine(Severity.Indeterminate, V188, CheckIdentifier.Fateful);
|
||||
@@ -104,10 +105,10 @@ public LegalityAnalysis(PKM pk)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
Valid = false;
|
||||
Parsed = true;
|
||||
AddLine(Severity.Invalid, V190, CheckIdentifier.Misc);
|
||||
Error = true;
|
||||
}
|
||||
Parsed = true;
|
||||
}
|
||||
|
||||
private void AddLine(Severity s, string c, CheckIdentifier i)
|
||||
@@ -321,7 +322,7 @@ private void updateChecks()
|
||||
}
|
||||
private string getLegalityReport()
|
||||
{
|
||||
if (!Parsed)
|
||||
if (!Parsed || pkm == null)
|
||||
return V189;
|
||||
|
||||
var lines = new List<string>();
|
||||
|
||||
@@ -84,7 +84,7 @@ public static class LegalityCheckStrings
|
||||
|
||||
public static string V187 {get; set;} = "Species does not exist in origin game.";
|
||||
public static string V188 {get; set;} = "Fateful Encounter with no matching Encounter. Has the Mystery Gift data been contributed?";
|
||||
public static string V194 { get; set;} = "Ingame Trade for Sun/Moon not implemented."; // Valid
|
||||
public static string V194 {get; set;} = "Ingame Trade for Sun/Moon not implemented."; // Valid
|
||||
|
||||
public static string V250 {get; set;} = "Gender matches PID.";
|
||||
public static string V251 {get; set;} = "PID-Gender mismatch.";
|
||||
|
||||
Reference in New Issue
Block a user