Skip to content

Commit 6657e68

Browse files
Fix crash with tooltips, potientially causing unclickable moves (#2328)
1 parent 2eff024 commit 6657e68

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

play.pokemonshowdown.com/src/battle-tooltips.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Pokemon, type Battle, type ServerPokemon } from "./battle";
1212
import { Dex, type ModdedDex, toID, type ID } from "./battle-dex";
1313
import type { BattleScene } from "./battle-animations";
1414
import { BattleLog } from "./battle-log";
15-
import { BattleNatures } from "./battle-dex-data";
15+
import { Move, BattleNatures } from "./battle-dex-data";
1616
import { BattleTextParser } from "./battle-text-parser";
1717

1818
class ModifiableValue {
@@ -560,7 +560,7 @@ export class BattleTooltips {
560560
if (item.zMoveFrom === move.name) {
561561
move = this.battle.dex.moves.get(item.zMove as string);
562562
} else if (move.category === 'Status') {
563-
move = new Dex.Move(move.id, "", {
563+
move = new Move(move.id, "", {
564564
...move,
565565
name: 'Z-' + move.name,
566566
});
@@ -592,7 +592,7 @@ export class BattleTooltips {
592592
break;
593593
}
594594
}
595-
move = new Dex.Move(zMove.id, zMove.name, {
595+
move = new Move(zMove.id, zMove.name, {
596596
...zMove,
597597
category: move.category,
598598
basePower: movePower,
@@ -606,7 +606,7 @@ export class BattleTooltips {
606606
let maxMove = this.getMaxMoveFromType(moveType, gmaxMove);
607607
const basePower = ['gmaxdrumsolo', 'gmaxfireball', 'gmaxhydrosnipe'].includes(maxMove.id) ?
608608
maxMove.basePower : move.maxMove.basePower;
609-
move = new Dex.Move(maxMove.id, maxMove.name, {
609+
move = new Move(maxMove.id, maxMove.name, {
610610
...maxMove,
611611
category: move.category,
612612
basePower,
@@ -616,7 +616,7 @@ export class BattleTooltips {
616616
}
617617

618618
if (categoryDiff) {
619-
move = new Dex.Move(move.id, move.name, {
619+
move = new Move(move.id, move.name, {
620620
...move,
621621
category,
622622
});

0 commit comments

Comments
 (0)