mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
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:
parent
fa78154df7
commit
8f8cf5bc9a
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue