Fix tradepair calculation (link trade eggs)

returned invalid pair values for gen7 due to 2 unused game IDs between
the gen6&gen7 pairs
This commit is contained in:
Kurt 2017-11-29 09:21:17 -08:00
parent fa78154df7
commit 8f8cf5bc9a

View file

@ -1430,7 +1430,14 @@ namespace PKHeX.Core
}
// Gen6+ update the origin game when hatched. Quick manip for X.Y<->A.O | S.M<->US.UM, ie X->A
GameVersion tradePair() => (GameVersion) (((int) ver - 4 * gen) ^ 2 + 4 * gen);
GameVersion tradePair()
{
if (ver <= GameVersion.OR) // gen6
return (GameVersion)((int)ver ^ 2);
if (ver <= GameVersion.MN) // gen7
return ver + 2;
return ver - 2;
}
}
// Utility