Sim/DexMoves: Deduplicate DataMove against parent mod (#10658)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run

This commit is contained in:
larry-the-table-guy 2024-11-09 06:47:14 -05:00 committed by GitHub
parent a86d04342d
commit 06da2bed6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,