Tweak level/origin check for moves

Valid species/movepools are already determined via the dexlevel and
prior methods, no need to check again with current species.

edge case: sing froslass from CXD won't check gen3 moves (ie, sing)
This commit is contained in:
Kurt 2017-06-26 20:30:44 -07:00
parent e635755dfd
commit 86d39f2c81
3 changed files with 2 additions and 5 deletions

View File

@ -2132,7 +2132,7 @@ private static int GetMaxLevelGeneration(PKM pkm)
private static int GetMaxLevelGeneration(PKM pkm, int generation)
{
if (!pkm.InhabitedGeneration(generation))
return -1;
return pkm.Met_Level;
if (pkm.Format <= 2)
{

View File

@ -258,9 +258,6 @@ private static CheckMoveResult[] ParseMoves(PKM pkm, int[] moves, int[] special,
int[] generations = GetGenMovesCheckOrder(pkm);
foreach (var gen in generations)
{
if (!pkm.InhabitedGeneration(gen))
continue;
var HMLearned = new int[0];
// Check if pokemon knows HM moves from generation 3 and 4 but are not valid yet, that means it cant learn the HMs in future generations
bool KnowDefogWhirlpool = false;

View File

@ -533,7 +533,7 @@ public bool InhabitedGeneration(int Generation, int species = -1)
return false;
// Sanity Check Species ID
if (Legal.GetMaxSpeciesOrigin(GenNumber) < species && !Legal.GetFutureGenEvolutions(GenNumber).Contains(species))
if (Legal.GetMaxSpeciesOrigin(Generation) < species && !Legal.GetFutureGenEvolutions(Generation).Contains(species))
return false;
// Trade generation 1 -> 2