Fix misc problems

flag undistributed gen3 events
fix gen3 string writing (resized then expanded yields 00, missing
terminator), closes #1204
fix stackoverflow, fix pkmeditor template loading save prompt, closes
#1207
This commit is contained in:
Kurt 2017-06-08 20:57:30 -07:00
parent b5b5ebd852
commit 63b18ff51f
6 changed files with 13 additions and 5 deletions

View file

@ -143,6 +143,9 @@ namespace PKHeX.Core
if (pkm.Version == 15) if (pkm.Version == 15)
verifyCXD(); verifyCXD();
if (info.EncounterMatch is WC3 z && z.NotDistributed)
AddLine(Severity.Invalid, V413, CheckIdentifier.Encounter);
} }
private void parsePK4(PKM pk) private void parsePK4(PKM pk)
{ {

View file

@ -16,7 +16,7 @@ namespace PKHeX.Core
public static bool AllowGen1Tradeback = false; public static bool AllowGen1Tradeback = false;
public static bool AllowGen2VCTransfer => AllowGen1Tradeback; public static bool AllowGen2VCTransfer => AllowGen1Tradeback;
public static bool AllowGen2VCCrystal = false; public static bool AllowGen2VCCrystal = false;
public static bool AllowGen2Crystal => AllowGBCartEra || AllowGen2Crystal; public static bool AllowGen2Crystal => AllowGBCartEra || AllowGen2VCCrystal;
public static bool AllowGen2MoveReminder => AllowGBCartEra; public static bool AllowGen2MoveReminder => AllowGBCartEra;
/// <summary>Setting to specify if the e-berry index item is an eningma berry or a e-reader berry and the name of the e-reader berry</summary> /// <summary>Setting to specify if the e-berry index item is an eningma berry or a e-reader berry and the name of the e-reader berry</summary>

View file

@ -363,8 +363,9 @@ namespace PKHeX.Core
public static string V352 {get; set;} = "Arceus from Hall of Origin. Unreleased event."; public static string V352 {get; set;} = "Arceus from Hall of Origin. Unreleased event.";
public static string V353 {get; set;} = "Non japanese Mew from Faraway Island. Unreleased event."; public static string V353 {get; set;} = "Non japanese Mew from Faraway Island. Unreleased event.";
public static string V354 {get; set;} = "Non Platinum Shaymin from Flower Paradise. Unreleased event."; public static string V354 {get; set;} = "Non Platinum Shaymin from Flower Paradise. Unreleased event.";
public static string V383 {get; set;} = "Non Platinum Darkrai from Newmoon Island.Unreleased event."; public static string V383 {get; set;} = "Non Platinum Darkrai from Newmoon Island. Unreleased event.";
public static string V384 {get; set;} = "Johto Route 45 surfing encounter. Unreachable Water tiles."; public static string V384 {get; set;} = "Johto Route 45 surfing encounter. Unreachable Water tiles.";
public static string V413 {get; set;} = "Unreleased event.";
public static string V357 {get; set;} = "Only one Ninjask move allowed."; public static string V357 {get; set;} = "Only one Ninjask move allowed.";
public static string V358 {get; set;} = "Inherited move learned by Level-up. Incompatible with event egg moves."; public static string V358 {get; set;} = "Inherited move learned by Level-up. Incompatible with event egg moves.";
public static string V359 {get; set;} = "Unable to match a gift egg encounter from origin game."; public static string V359 {get; set;} = "Unable to match a gift egg encounter from origin game.";

View file

@ -1403,7 +1403,7 @@ namespace PKHeX.Core
} }
if (strdata.Length > 0) if (strdata.Length > 0)
strdata[strdata.Length - 1] = 0xFF; strdata[strdata.Length - 1] = 0xFF;
if (strdata.Length > maxLength) if (strdata.Length > maxLength && padTo <= maxLength)
Array.Resize(ref strdata, maxLength); Array.Resize(ref strdata, maxLength);
if (strdata.Length < padTo) if (strdata.Length < padTo)
{ {

View file

@ -1852,7 +1852,11 @@ namespace PKHeX.WinForms.Controls
public void TemplateFields(PKM template) public void TemplateFields(PKM template)
{ {
if (template != null) if (template != null)
{ populateFields(template); return; } {
populateFields(template);
lastData = null;
return;
}
if (CB_GameOrigin.Items.Count > 0) if (CB_GameOrigin.Items.Count > 0)
CB_GameOrigin.SelectedIndex = 0; CB_GameOrigin.SelectedIndex = 0;
CB_Move1.SelectedValue = 1; CB_Move1.SelectedValue = 1;