Skip to content

Commit 06da2be

Browse files
Sim/DexMoves: Deduplicate DataMove against parent mod (smogon#10658)
1 parent a86d043 commit 06da2be

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sim/dex-moves.ts

+12
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,18 @@ export class DexMoves {
655655
if (move.gen > this.dex.gen) {
656656
(move as any).isNonstandard = 'Future';
657657
}
658+
if (this.dex.parentMod) {
659+
// If move is exactly identical to parentMod's move, reuse parentMod's copy
660+
const parentMod = this.dex.mod(this.dex.parentMod);
661+
if (moveData === parentMod.data.Moves[id]) {
662+
const parentMove = parentMod.moves.getByID(id);
663+
if (move.isNonstandard === parentMove.isNonstandard &&
664+
move.desc === parentMove.desc &&
665+
move.shortDesc === parentMove.shortDesc) {
666+
move = parentMove;
667+
}
668+
}
669+
}
658670
} else {
659671
move = new DataMove({
660672
name: id, exists: false,

0 commit comments

Comments
 (0)