Flag unparsed pkms

With every format now supported, can flag GameVersion=0 pkm
This commit is contained in:
Kurt 2017-05-17 21:50:52 -07:00
parent a415ca78df
commit fc676ec648
2 changed files with 8 additions and 7 deletions

View file

@ -40,7 +40,7 @@ namespace PKHeX.Core
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 @@ namespace PKHeX.Core
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 @@ namespace PKHeX.Core
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 @@ namespace PKHeX.Core
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 @@ namespace PKHeX.Core
{
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 @@ namespace PKHeX.Core
}
private string getLegalityReport()
{
if (!Parsed)
if (!Parsed || pkm == null)
return V189;
var lines = new List<string>();

View file

@ -84,7 +84,7 @@ namespace PKHeX.Core
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.";