From 36031ad51fe41219e7cbbf3dff522226d0412aad Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 17 Dec 2022 23:38:04 -0800 Subject: [PATCH] Update PKM.cs --- PKHeX.Core/PKM/PKM.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/PKHeX.Core/PKM/PKM.cs b/PKHeX.Core/PKM/PKM.cs index a43cde425..bf35e32d4 100644 --- a/PKHeX.Core/PKM/PKM.cs +++ b/PKHeX.Core/PKM/PKM.cs @@ -257,16 +257,23 @@ public abstract class PKM : ISpeciesForm, ITrainerID, IGeneration, IShiny, ILang } } + private bool IsDisplay7 => Generation switch + { + >= 7 => true, + -1 when IsEgg && this is PK9 => true, + _ => false, + }; + public int DisplayTID { - get => Generation >= 7 ? TrainerID7 : TID; - set { if (Generation >= 7) TrainerID7 = value; else TID = value; } + get => IsDisplay7 ? TrainerID7 : TID; + set { if (IsDisplay7) TrainerID7 = value; else TID = value; } } public int DisplaySID { - get => Generation >= 7 ? TrainerSID7 : SID; - set { if (Generation >= 7) TrainerSID7 = value; else SID = value; } + get => IsDisplay7 ? TrainerSID7 : SID; + set { if (IsDisplay7) TrainerSID7 = value; else SID = value; } } private void SetID7(int sid7, int tid7)