mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-09 08:57:56 -05:00
Permit all generations prior to requested generation for know move check
This commit is contained in:
parent
cbc57dc794
commit
acf811f5c1
|
|
@ -132,7 +132,7 @@ internal static bool GetCanRelearnMove(PKM pkm, int move, int generation, IReadO
|
|||
return MoveList.GetValidMoves(pkm, version, evos, generation, types: MoveSourceType.Reminder).Contains(move);
|
||||
}
|
||||
|
||||
internal static bool GetCanKnowMove(PKM pkm, int move, int generation, IReadOnlyList<EvoCriteria> evos, GameVersion version = GameVersion.Any)
|
||||
internal static bool GetCanKnowMove(PKM pkm, int move, int generation, IReadOnlyList<IReadOnlyList<EvoCriteria>> evos, GameVersion version = GameVersion.Any)
|
||||
{
|
||||
if (pkm.Species == (int)Species.Smeargle)
|
||||
return !InvalidSketch.Contains(move);
|
||||
|
|
@ -140,7 +140,15 @@ internal static bool GetCanKnowMove(PKM pkm, int move, int generation, IReadOnly
|
|||
if (generation >= 8 && MoveEgg.GetIsSharedEggMove(pkm, generation, move))
|
||||
return true;
|
||||
|
||||
return MoveList.GetValidMoves(pkm, version, evos, generation, types: MoveSourceType.All).Contains(move);
|
||||
if (evos.Count <= generation)
|
||||
return false;
|
||||
for (int i = 1; i <= generation; i++)
|
||||
{
|
||||
var moves = MoveList.GetValidMoves(pkm, version, evos[i], i, types: MoveSourceType.All);
|
||||
if (moves.Contains(move))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
internal static bool IsCatchRateHeldItem(int rate) => ParseSettings.AllowGen1Tradeback && HeldItems_GSC.Contains((ushort) rate);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ private static bool CanKnowMove(PKM pkm, MemoryVariableSet memory, int gen, Lega
|
|||
if (pkm.HasMove(move))
|
||||
return true;
|
||||
|
||||
if (Legal.GetCanKnowMove(pkm, memory.Variable, gen, info.EvoChainsAllGens[gen]))
|
||||
if (Legal.GetCanKnowMove(pkm, memory.Variable, gen, info.EvoChainsAllGens))
|
||||
return true;
|
||||
|
||||
var enc = info.EncounterMatch;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user