Update encountertrade ability legality check

check for encountertrade edge case first, then ability capsule

Closes #1163
This commit is contained in:
Kurt 2017-05-23 20:10:57 -07:00
parent b8a799f7ed
commit 5f94a2e0f4

View file

@ -1458,11 +1458,10 @@ namespace PKHeX.Core
if (!(AbilityUnchanged ?? false) || EncounterAbility == 0 || pkm.AbilityNumber == EncounterAbility)
return false;
if (pkm.Format >= 6 && abilities[0] != abilities[1] && pkm.AbilityNumber < 4) // Ability Capsule
AddLine(Severity.Valid, V109, CheckIdentifier.Ability);
else if (pkm.Gen3 && EncounterMatch is EncounterTrade && EncounterAbility == 1 << abilval)
// Edge case (Static PID?)
if (EncounterMatch is EncounterTrade z && EncounterAbility == 1 << abilval && z.Species == pkm.Species) // Edge case (Static PID?)
AddLine(Severity.Valid, V115, CheckIdentifier.Ability);
else if (pkm.Format >= 6 && abilities[0] != abilities[1] && pkm.AbilityNumber < 4) // Ability Capsule
AddLine(Severity.Valid, V109, CheckIdentifier.Ability);
else
AddLine(Severity.Invalid, V223, CheckIdentifier.Ability);
return true;