mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 06:34:19 +00:00
Add missing filter overrides
Were using default filter behavior, which needs to be tweaked to account for the original met location/level not being present (ie skip the minLevel bounds check). Hardcode logic for HasOriginalMetLocation for simplicity Closes #2389 , thanks @Ammako !
This commit is contained in:
parent
b41f2a3062
commit
7e70d83664
5 changed files with 27 additions and 0 deletions
|
@ -124,5 +124,14 @@ namespace PKHeX.Core
|
|||
{
|
||||
return entries.Select(GetArea3).Where(Area => Area.Slots.Length != 0).ToArray();
|
||||
}
|
||||
|
||||
protected override IEnumerable<EncounterSlot> GetMatchFromEvoLevel(PKM pkm, IEnumerable<DexLevel> vs, int minLevel)
|
||||
{
|
||||
var slots = Slots.Where(slot => vs.Any(evo => evo.Species == slot.Species && evo.Level >= slot.LevelMin));
|
||||
|
||||
if (pkm.Format != 3) // transferred to Gen4+
|
||||
return slots.Where(slot => slot.LevelMin <= minLevel);
|
||||
return slots.Where(s => s.IsLevelWithinRange(minLevel));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -58,5 +58,14 @@ namespace PKHeX.Core
|
|||
{
|
||||
EncounterUtil.MarkEncountersStaticMagnetPullPermutation(grp, PersonalTable.HGSS, trackPermute);
|
||||
}
|
||||
|
||||
protected override IEnumerable<EncounterSlot> GetMatchFromEvoLevel(PKM pkm, IEnumerable<DexLevel> vs, int minLevel)
|
||||
{
|
||||
var slots = Slots.Where(slot => vs.Any(evo => evo.Species == slot.Species && evo.Level >= slot.LevelMin));
|
||||
|
||||
if (pkm.Format != 4) // transferred to Gen5+
|
||||
return slots.Where(slot => slot.LevelMin <= minLevel);
|
||||
return slots.Where(s => s.IsLevelWithinRange(minLevel));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -128,5 +128,14 @@ namespace PKHeX.Core
|
|||
return slots;
|
||||
}
|
||||
}
|
||||
|
||||
protected override IEnumerable<EncounterSlot> GetMatchFromEvoLevel(PKM pkm, IEnumerable<DexLevel> vs, int minLevel)
|
||||
{
|
||||
var slots = Slots.Where(slot => vs.Any(evo => evo.Species == slot.Species && evo.Level >= slot.LevelMin));
|
||||
|
||||
if (pkm.Format >= 7 || !(pkm is PK2 pk2 && pk2.CaughtData != 0)) // transferred to Gen7+, or does not have Crystal met data
|
||||
return slots.Where(slot => slot.LevelMin <= minLevel);
|
||||
return slots.Where(s => s.IsLevelWithinRange(minLevel));
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue