Fix Link Trade eggs

Thanks Wanderer1391!

Traded eggs get their Met Location set to 30002.
When an egg hatches, if Met Location > 0, copy Met Location to Egg
Location and set Met Location equal to current overworld location.
This commit is contained in:
Kaphotics 2016-03-30 19:07:52 -07:00
parent 5fb65c5ba7
commit 8af8602c31
2 changed files with 6 additions and 1 deletions

View File

@ -206,6 +206,11 @@ private LegalityCheck verifyEncounter()
return new LegalityCheck(Severity.Invalid, "Invalid met level, expected 1.");
if (pk6.IsEgg)
{
if (pk6.Egg_Location == 30002)
return new LegalityCheck(Severity.Invalid, "Egg location shouldn't be 'traded' for an un-hatched egg.");
if (pk6.Met_Location == 30002)
return new LegalityCheck(Severity.Valid, "Valid traded un-hatched egg.");
return pk6.Met_Location == 0
? new LegalityCheck(Severity.Valid, "Valid un-hatched egg.")
: new LegalityCheck(Severity.Invalid, "Invalid location for un-hatched egg (expected ID:0)");

View File

@ -701,7 +701,7 @@ private void TradeHT(string SAV_Trainer, int SAV_COUNTRY, int SAV_REGION, int SA
// Misc Updates
private void UpdateEgg(int Day, int Month, int Year)
{
Egg_Location = 30002;
Met_Location = 30002;
Egg_Day = Day;
Egg_Month = Month;
Egg_Year = Year - 2000;