Fix gen3 static encounter eggs

add exclusions for egg data, fixes wynaut and togepi ingame gift eggs.
Closes #1322
This commit is contained in:
Kurt
2017-07-12 09:02:54 -07:00
parent 23c4e81dea
commit 08ca4dd147

View File

@@ -294,7 +294,7 @@ private static IEnumerable<EncounterStatic> GetValidStaticEncounter(PKM pkm, Gam
IEnumerable<EncounterStatic> poss = GetStaticEncounters(pkm, gameSource: gameSource);
int lvl = GetMinLevelEncounter(pkm);
if (lvl <= 0)
if (lvl < 0)
yield break;
// Back Check against pkm
@@ -330,7 +330,7 @@ private static IEnumerable<EncounterStatic> GetMatchingStaticEncounters(PKM pkm,
{
if (e.Nature != Nature.Random && pkm.Nature != (int)e.Nature)
continue;
if (pkm.WasEgg ^ e.EggEncounter && pkm.Egg_Location == 0)
if (pkm.WasEgg ^ e.EggEncounter && pkm.Egg_Location == 0 && pkm.Format > 3)
continue;
if (pkm.Gen3 && e.EggLocation != 0) // Gen3 Egg
{
@@ -386,7 +386,10 @@ private static IEnumerable<EncounterStatic> GetMatchingStaticEncounters(PKM pkm,
if (!e.EggEncounter && e.Location != 0 && e.Location != pkm.Met_Location)
continue;
if (e.Level != lvl)
continue;
{
if (!(pkm.Format == 3 && e.EggEncounter && lvl == 0))
continue;
}
}
else if (e.Level > lvl)
continue;