Fix Duplicate Egg Moves (#736)

Fixes an issue where egg moves could get duplicated onto a starter Pokémon's moveset.
pull/799/head
Benjamin Odom 2024-05-12 13:56:37 -05:00 committed by GitHub
parent 2176d5854d
commit 512cc5b965
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -1576,6 +1576,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
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));
// 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 formText = species?.forms[formIndex]?.formKey.split('-');