mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-04-25 15:40:31 -05:00
Sim/DexMoves: Deduplicate DataMove against parent mod (#10658)
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
Some checks are pending
Node.js CI / build (16.x) (push) Waiting to run
This commit is contained in:
parent
a86d04342d
commit
06da2bed6f
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user