Skip to content

Commit

Permalink
JEP fairy type, handle missing learnset data as error
Browse files Browse the repository at this point in the history
  • Loading branch information
Rezzo64 committed Dec 19, 2023
1 parent 7b5d9c4 commit 3c24d78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions play.pokemonshowdown.com/src/battle-dex-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -895,9 +895,14 @@ abstract class BattleTypedSearch<T extends SearchType> {
for (const learnedMove in overrideLearnsets[learnsetid]) learnset[learnedMove] = overrideLearnsets[learnsetid][learnedMove];
}
}
if (!Object.keys(learnset).length) { //Doesn't have learnset but one is loaded; some other mod gave it one
learnsetid = toID(this.dex.species.get(learnsetid).baseSpecies);
try {
if (!Object.keys(learnset).length) { //Doesn't have learnset but one is loaded; some other mod gave it one
learnsetid = toID(this.dex.species.get(learnsetid).baseSpecies);
}
} catch (e) {
console.log("Error: Unable to load learnset data for " + learnsetid + " in " + this.mod);
}

// Modified this function to account for pet mods with tradebacks enabled
const tradebacksMod = ['gen1expansionpack', 'gen1burgundy'];
if (learnset && (moveid in learnset) && (!(this.format.startsWith('tradebacks') || tradebacksMod.includes(this.mod)) ? learnset[moveid].includes(genChar) :
Expand Down
1 change: 1 addition & 0 deletions play.pokemonshowdown.com/src/battle-dex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,7 @@ class ModdedDex {
if (this.gen <= 3 && data.category !== 'Status') {
switch(this.modid) {
case 'gen1expansionpack':
case 'gen2expansionpack':
data.category = Dex.getKEPCategory(data.type);
break;
case 'gen2crystalseviiislands':
Expand Down

0 comments on commit 3c24d78

Please sign in to comment.