Skip to content

Commit

Permalink
Fix egg validation
Browse files Browse the repository at this point in the history
  • Loading branch information
TheImmortal committed Feb 12, 2017
1 parent 5efd47a commit b8c56f0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions team-validator.js
Expand Up @@ -770,8 +770,7 @@ class Validator {
} else if (learned.charAt(1) === 'E') {
// egg moves:
// only if that was the source
const noPastGenBreeding = noPastGen && tools.gen === 7;
if ((learnedGen >= 6 && !noPastGenBreeding) || lsetData.fastCheck) {
if (learnedGen >= 6 || lsetData.fastCheck) {
// gen 6 doesn't have egg move incompatibilities except for certain cases with baby Pokemon
learned = learnedGen + 'E' + (template.prevo ? template.id : '');
sources.push(learned);
Expand Down Expand Up @@ -818,7 +817,7 @@ class Validator {
atLeastOne = true;
break;
}
if (noPastGenBreeding) {
if (noPastGen) {
if (parseInt(fatherLatestMoveGen) < tools.gen) continue;
atLeastOne = true;
break;
Expand All @@ -834,7 +833,7 @@ class Validator {
sources.push(learned + father.id);
if (limitedEgg !== false) limitedEgg = true;
}
if (atLeastOne && noPastGenBreeding) {
if (atLeastOne && noPastGen) {
// gen 6+ doesn't have egg move incompatibilities except for certain cases with baby Pokemon
learned = learnedGen + 'E' + (template.prevo ? template.id : '');
sources.push(learned);
Expand All @@ -844,7 +843,7 @@ class Validator {
// chainbreeding with itself
// e.g. ExtremeSpeed Dragonite
if (!atLeastOne) {
if (noPastGenBreeding) continue;
if (noPastGen) continue;
sources.push(learned + template.id);
limitedEgg = 'self';
}
Expand Down

3 comments on commit b8c56f0

@Zarel
Copy link
Member

@Zarel Zarel commented on b8c56f0 Feb 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blah, now I have three commits to review...

@Zarel
Copy link
Member

@Zarel Zarel commented on b8c56f0 Feb 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh you're ruining all this useful code D:

@Zarel
Copy link
Member

@Zarel Zarel commented on b8c56f0 Feb 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is that at least four of your commits have been done without really understanding how the validator works and need to be partially reverted, but I don't even know if that's all of them or if something else is wrong...

Please sign in to comment.