Fix Duplicate Egg Moves

Fixes an issue where egg moves could get duplicated onto a starter Pokémon's moveset.
This commit is contained in:
Benjamin Odom 2024-05-11 02:11:25 -05:00
parent 28c75e4377
commit 2cee8a610b

View File

@ -1569,6 +1569,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
if (this.starterMoveset.length < 4 && this.starterMoveset.length < availableStarterMoves.length) if (this.starterMoveset.length < 4 && this.starterMoveset.length < availableStarterMoves.length)
this.starterMoveset.push(...availableStarterMoves.filter(sm => this.starterMoveset.indexOf(sm) === -1).slice(0, 4 - this.starterMoveset.length)); this.starterMoveset.push(...availableStarterMoves.filter(sm => this.starterMoveset.indexOf(sm) === -1).slice(0, 4 - this.starterMoveset.length));
// Remove duplicate moves
this.starterMoveset = this.starterMoveset.filter(
(move, i) => {
return this.starterMoveset.indexOf(move) === i;
}) as StarterMoveset;
const speciesForm = getPokemonSpeciesForm(species.speciesId, formIndex); const speciesForm = getPokemonSpeciesForm(species.speciesId, formIndex);
const formText = species?.forms[formIndex]?.formKey.split('-'); const formText = species?.forms[formIndex]?.formKey.split('-');