Skip to content

Commit

Permalink
Properly validate cosmetic forms in learnsetDomain
Browse files Browse the repository at this point in the history
https://www.smogon.com/forums/threads/shellos-east-has-weird-incompatible-moves-in-gen-9-natdex-draft.3752399/

Using the same logic that getFullLearnset uses.

Also fixes getMovePool so that the two different places that change eggMovesOnly do not override each other.
  • Loading branch information
dot-Comfey committed Oct 2, 2024
1 parent 2e805a2 commit 558af45
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sim/dex-species.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ export class DexSpecies {
const movePool = new Set<ID>();
for (const {species, learnset} of this.getFullLearnset(id)) {
for (const moveid in learnset) {
eggMovesOnly = this.eggMovesOnly(species, this.get(id));
if (!eggMovesOnly) eggMovesOnly = this.eggMovesOnly(species, this.get(id));
if (eggMovesOnly) {
if (learnset[moveid].some(source => source.startsWith('9E'))) {
movePool.add(moveid as ID);
Expand Down
3 changes: 3 additions & 0 deletions sim/team-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2779,6 +2779,9 @@ export class TeamValidator {
nextSpecies = baseSpecies;
let speciesCount = 0;
if (!tradebackEligible) {
if (!dex.species.getLearnsetData(nextSpecies.id).learnset) {
nextSpecies = dex.species.get(nextSpecies.changesFrom || nextSpecies.baseSpecies);
}
while (nextSpecies) {
for (let gen = nextSpecies.gen; gen <= dex.gen; gen++) {
/**
Expand Down
1 change: 1 addition & 0 deletions test/sim/team-validator/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ describe('Team Validator', function () {

team = [
{species: 'incineroar', ability: 'blaze', moves: ['knockoff', 'partingshot'], evs: {hp: 1}},
{species: 'shelloseast', ability: 'stickyhold', moves: ['infestation', 'stringshot'], evs: {hp: 1}},
];
assert.legalTeam(team, 'gen8ou');
});
Expand Down

0 comments on commit 558af45

Please sign in to comment.