Skip to content

Commit

Permalink
fix: some pm data without temp evo
Browse files Browse the repository at this point in the history
  • Loading branch information
Rplus committed Oct 28, 2024
1 parent ee37e09 commit dc1787d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions task/genGM.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,22 @@ let twData = JSON.parse(contents_tw);
if (!tempEvoOverrides) {
return;
}

if (!tempEvoOverrides.some(evo => evo.tempEvoId)) {
console.log(111, d.data.templateId, tempEvoOverrides);
return;
}

if (/_NORMAL/.test(d.data.pokemonSettings.form)) {
return;
}

tempEvoOverrides.forEach(evo => {
tempEvoOverrides.filter(evo => evo.tempEvoId).forEach(evo => {
let tempPm = JSON.parse(JSON.stringify(d));
delete tempPm.data.pokemonSettings.evolutionBranch;
delete tempPm.data.pokemonSettings.tempEvoOverrides;
if (!evo.tempEvoId) {
console.log(333, evo);
console.log(333, d.templateId, tempEvoOverrides);
}
let idSuffix = evo.tempEvoId?.replace('TEMP_EVOLUTION', '')
let id = tempPm.templateId + idSuffix;
Expand Down

0 comments on commit dc1787d

Please sign in to comment.