Skip to content

Commit

Permalink
Sim/DexMoves: Deduplicate DataMove against parent mod (smogon#10658)
Browse files Browse the repository at this point in the history
  • Loading branch information
larry-the-table-guy authored Nov 9, 2024
1 parent a86d043 commit 06da2be
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sim/dex-moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 06da2be

Please sign in to comment.