From 016ebb86ad5acb60a03cfc19eebc0de2acfc230c Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 27 Nov 2020 20:44:44 -0800 Subject: [PATCH] Update AbilityVerifier.cs --- PKHeX.Core/Legality/Verifiers/AbilityVerifier.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PKHeX.Core/Legality/Verifiers/AbilityVerifier.cs b/PKHeX.Core/Legality/Verifiers/AbilityVerifier.cs index 71f6e4ac2..c823be7cf 100644 --- a/PKHeX.Core/Legality/Verifiers/AbilityVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/AbilityVerifier.cs @@ -49,6 +49,16 @@ private CheckResult VerifyAbility(LegalityAnalysis data) int an = num >> 1; if (an >= abilities.Count || abilities[an] != ability) return GetInvalid(LAbilityMismatchFlag); + + // Check AbilityNumber for transfers without unique abilities + int gen = data.Info.Generation; + if (3 <= gen && gen <= 5 && num != 4) + { + // To determine AbilityNumber [PK5->PK6], check if the first ability in Personal matches the ability. + // It is not possible to flip it to the other index as capsule requires unique abilities. + if (abilities[0] == abilities[1] && num != 1) + return GetInvalid(LAbilityMismatchFlag); + } } if (format >= 8) // Ability Patch