From 34abbd81af04ecd6954121c987cb42bb948b60ac Mon Sep 17 00:00:00 2001 From: Daniel Porter Date: Mon, 14 Nov 2016 15:08:54 +0000 Subject: [PATCH] Don't cast 5+ string properties as version 6 With the addition of Generation 7, this "down-converts" these properties to the previous generation, and are incompatible. It should be safe to use the native properties' ToString() functions to do this job. --- PKHeX/Subforms/frmReport.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PKHeX/Subforms/frmReport.cs b/PKHeX/Subforms/frmReport.cs index a69afee12..91ddf180a 100644 --- a/PKHeX/Subforms/frmReport.cs +++ b/PKHeX/Subforms/frmReport.cs @@ -36,9 +36,9 @@ public class Preview public string OT => pkm.OT_Name; public string Version => Main.GameStrings.gamelist[pkm.Version]; public string OTLang => Main.GameStrings.gamelanguages[pkm.Language] ?? $"UNK {pkm.Language}"; - public string CountryID => pkm.Format > 5 ? ((PK6) pkm).Country.ToString() : "N/A"; - public string RegionID => pkm.Format > 5 ? ((PK6) pkm).Region.ToString() : "N/A"; - public string DSRegionID => pkm.Format > 5 ? ((PK6) pkm).ConsoleRegion.ToString() : "N/A"; + public string CountryID => pkm.Format > 5 ? pkm.Country.ToString() : "N/A"; + public string RegionID => pkm.Format > 5 ? pkm.Region.ToString() : "N/A"; + public string DSRegionID => pkm.Format > 5 ? pkm.ConsoleRegion.ToString() : "N/A"; #region Extraneous public string EC => pkm.EncryptionConstant.ToString("X8"); @@ -65,9 +65,9 @@ public class Preview public int Sheen => pkm.CNT_Sheen; public int Markings => pkm.MarkValue; - public string NotOT => pkm.Format > 5 ? ((PK6) pkm).HT_Name : "N/A"; + public string NotOT => pkm.Format > 5 ? pkm.HT_Name : "N/A"; - public int AbilityNum => pkm.Format > 5 ? ((PK6) pkm).AbilityNumber : -1; + public int AbilityNum => pkm.Format > 5 ? pkm.AbilityNumber : -1; public int GenderFlag => pkm.Gender; public int AltForms => pkm.AltForm; public int PKRS_Strain => pkm.PKRS_Strain; @@ -278,4 +278,4 @@ public void SetPropertyAndDirection(PropertyDescriptor descriptor, ListSortDirec SetListSortDirection(direction); } } -} \ No newline at end of file +}