From e02f7ef30f294583652e41d7376d15a9b6d2e49d Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 18 Jun 2019 20:54:59 -0700 Subject: [PATCH] Reduce allocation required for ability check --- PKHeX.Core/PKM/Shared/_K3.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKHeX.Core/PKM/Shared/_K3.cs b/PKHeX.Core/PKM/Shared/_K3.cs index 85a2d9114..73746f4a3 100644 --- a/PKHeX.Core/PKM/Shared/_K3.cs +++ b/PKHeX.Core/PKM/Shared/_K3.cs @@ -25,7 +25,7 @@ public abstract class _K3 : PKM, IRibbonSetEvent3, IRibbonSetCommon3, IRibbonSet public override bool WasGiftEgg => IsEgg && Met_Location == 253; // Gift Egg, indistinguible from normal eggs after hatch public override bool WasEventEgg => IsEgg && Met_Location == 255; // Event Egg, indistinguible from normal eggs after hatch - public override int Ability { get { var pi = (PersonalInfoG3)PersonalInfo; return pi.Abilities[pi.HasSecondAbility && AbilityBit ? 1 : 0]; } set { } } + public override int Ability { get { var pi = (PersonalInfoG3)PersonalInfo; return AbilityBit && pi.Ability2 != 0 ? pi.Ability2 : pi.Ability1; } set { } } public override uint EncryptionConstant { get => PID; set { } } public override int Nature { get => (int)(PID % 25); set { } } public override int AltForm { get => Species == 201 ? PKX.GetUnownForm(PID) : 0; set { } }