From c3215083c205bd1ef02305122000f314845dbc50 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 5 Jun 2020 09:55:00 -0700 Subject: [PATCH] Update ShowdownSet.cs --- PKHeX.Core/Editing/ShowdownSet.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PKHeX.Core/Editing/ShowdownSet.cs b/PKHeX.Core/Editing/ShowdownSet.cs index bcbef5f67..5649baa04 100644 --- a/PKHeX.Core/Editing/ShowdownSet.cs +++ b/PKHeX.Core/Editing/ShowdownSet.cs @@ -399,7 +399,7 @@ private void ParseFirstLine(string first) } else { - ParseFirstLineNoItem(first.Trim()); + ParseFirstLineNoItem(first); } } @@ -472,10 +472,11 @@ private bool ParseSpeciesForm(string spec) // failure to parse, check edge cases foreach (var e in DashedSpecies) { - if (!spec.StartsWith(Strings.Species[e].Replace("♂", "-M").Replace("♀", "-F"))) + var sn = Strings.Species[e]; + if (!spec.StartsWith(sn.Replace("♂", "-M").Replace("♀", "-F"))) continue; Species = e; - Form = spec.Substring(Strings.Species[e].Length); + Form = spec.Substring(sn.Length); return true; } @@ -503,7 +504,7 @@ private void ParseSpeciesNickname(string line) { int end = line.IndexOf(')'); n2 = line.Substring(index + 1, end - 1); - n1 = line.Substring(end + 2); + n1 = end < line.Length - 2 ? line.Substring(end + 2) : n2; } if (ParseSpeciesForm(n2))