From 06da2bed6fd19bf17cc096df0ba381acd39ab7ec Mon Sep 17 00:00:00 2001 From: larry-the-table-guy <180724454+larry-the-table-guy@users.noreply.github.com> Date: Sat, 9 Nov 2024 06:47:14 -0500 Subject: [PATCH] Sim/`DexMoves`: Deduplicate `DataMove` against parent mod (#10658) --- sim/dex-moves.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sim/dex-moves.ts b/sim/dex-moves.ts index 7853c5e2135d..370efb45589e 100644 --- a/sim/dex-moves.ts +++ b/sim/dex-moves.ts @@ -655,6 +655,18 @@ export class DexMoves { if (move.gen > this.dex.gen) { (move as any).isNonstandard = 'Future'; } + if (this.dex.parentMod) { + // If move is exactly identical to parentMod's move, reuse parentMod's copy + const parentMod = this.dex.mod(this.dex.parentMod); + if (moveData === parentMod.data.Moves[id]) { + const parentMove = parentMod.moves.getByID(id); + if (move.isNonstandard === parentMove.isNonstandard && + move.desc === parentMove.desc && + move.shortDesc === parentMove.shortDesc) { + move = parentMove; + } + } + } } else { move = new DataMove({ name: id, exists: false,