mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-25 08:10:48 -05:00
Enhance traded eggs version sharing check
No longer indicate traded eggs from gen3 as sharing OT details.
This commit is contained in:
parent
e1f2a90c6b
commit
49d40d2e26
|
|
@ -359,11 +359,20 @@ private static bool IsSharedVersion(PKM pp, LegalityAnalysis pa, PKM cp, Legalit
|
|||
if (pa.Info.Generation != ca.Info.Generation)
|
||||
return false;
|
||||
|
||||
if (pa.EncounterMatch.EggEncounter && pp.WasTradedEgg)
|
||||
// Gen3/4 traded eggs do not have an Egg Location, and do not update the Version upon hatch.
|
||||
// These eggs can obtain another trainer's TID/SID/OT and be valid with a different version ID.
|
||||
if (pa.EncounterMatch.EggEncounter && IsTradedEggVersionNoUpdate(pp, pa))
|
||||
return false; // version doesn't update on trade
|
||||
if (ca.EncounterMatch.EggEncounter && cp.WasTradedEgg)
|
||||
if (ca.EncounterMatch.EggEncounter && IsTradedEggVersionNoUpdate(cp, ca))
|
||||
return false; // version doesn't update on trade
|
||||
|
||||
static bool IsTradedEggVersionNoUpdate(PKM pk, LegalityAnalysis la) => la.Info.Generation switch
|
||||
{
|
||||
3 => true, // No egg location, assume can be traded. Doesn't update version upon hatch.
|
||||
4 => pk.WasTradedEgg, // Gen4 traded eggs do not update version upon hatch.
|
||||
_ => false, // Gen5+ eggs have an egg location, and update the version upon hatch.
|
||||
};
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user