From 512cc5b965cba4b60474f6b67ec78eb58af85b09 Mon Sep 17 00:00:00 2001 From: Benjamin Odom Date: Sun, 12 May 2024 13:56:37 -0500 Subject: [PATCH] Fix Duplicate Egg Moves (#736) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes an issue where egg moves could get duplicated onto a starter Pokémon's moveset. --- src/ui/starter-select-ui-handler.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index b341cf947..81f081e4c 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1575,6 +1575,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler { // Consolidate move data if it contains an incompatible move 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);