Ingame Trade exclusion

Return early if not ingame trade
This commit is contained in:
Kaphotics 2016-03-26 16:40:12 -07:00
parent ae424cb116
commit a277b4a734
2 changed files with 4 additions and 1 deletions

View file

@ -258,6 +258,8 @@ namespace PKHeX
}
internal static EncounterTrade getValidIngameTrade(PK6 pk6)
{
if (!pk6.WasIngameTrade)
return null;
int lang = pk6.Language;
if (lang == 0)
return null;
@ -287,7 +289,7 @@ namespace PKHeX
return null;
if (z.Level != pk6.Met_Level)
return null;
if (z.Nature != Nature.Random && ((int)z.Nature != pk6.Nature))
if (z.Nature != Nature.Random && (int)z.Nature != pk6.Nature)
return null;
if (z.Gender != pk6.Gender)
return null;

View file

@ -752,5 +752,6 @@ namespace PKHeX
public bool WasEvent => FatefulEncounter && Met_Location > 40000;
public bool WasEventEgg => FatefulEncounter && (Egg_Location > 40000 || Egg_Location == 30002) && Met_Level == 1;
public bool WasTradedEgg => Egg_Location == 30002;
public bool WasIngameTrade => Met_Location == 30001;
}
}