From 600159362efa7f87484b7571fbfc2dbc255b00cc Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Tue, 15 Mar 2016 18:14:17 -0700 Subject: [PATCH] Fix Showdown Mega-X/Y Form parsing Thanks Odaxis! --- Misc/PKX.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Misc/PKX.cs b/Misc/PKX.cs index b6932efad..02cdb5390 100644 --- a/Misc/PKX.cs +++ b/Misc/PKX.cs @@ -1328,6 +1328,8 @@ public ShowdownSet(string input = null) if (tmp.Length < 2) return; Species = Array.IndexOf(species, tmp[0].Replace(" ", "")); Form = tmp[1].Replace(" ", ""); + if (tmp.Length > 2) + Form += " " + tmp[2]; } if (Species < -1) return; @@ -1416,6 +1418,8 @@ public ShowdownSet(string input = null) string[] tmp = spec.Split(new[] { "-" }, StringSplitOptions.None); Species = Array.IndexOf(species, tmp[0].Replace(" ", "")); Form = tmp[1].Replace(" ", ""); + if (tmp.Length > 2) + Form += " " + tmp[2]; } } else if (brokenline[0].Contains("Nature")) @@ -1433,7 +1437,7 @@ public string getText() // First Line: Name, Nickname, Gender, Item string result = string.Format(species[Species] != Nickname ? "{0} ({1})" : "{1}", Nickname, - species[Species] + ((Form ?? "") != "" ? "-" + Form : "")) // Species (& Form if necessary) + species[Species] + ((Form ?? "") != "" ? "-" + Form.Replace("Mega ", "Mega-") : "")) // Species (& Form if necessary) + Gender + (Item != 0 ? " @ " + items[Item] : "") + Environment.NewLine; // IVs