Update battler-tags.ts

This commit is contained in:
Bertie690 2025-05-20 14:41:10 -04:00 committed by GitHub
parent 5a75169493
commit e6ccd78e00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -308,13 +308,14 @@ export class DisabledTag extends MoveRestrictionBattlerTag {
* and showing a message. * and showing a message.
*/ */
override onAdd(pokemon: Pokemon): void { override onAdd(pokemon: Pokemon): void {
// Disable fails against struggle or an empty move history, but we still need to check for // Disable fails against struggle or an empty move history
// Cursed Body // TODO: Confirm if this is redundant given Disable/Cursed Body's disable conditions
const move = pokemon.getLastNonVirtualMove(); const move = pokemon.getLastNonVirtualMove();
if (isNullOrUndefined(move) || move.move === Moves.STRUGGLE) { if (isNullOrUndefined(move) || move.move === Moves.STRUGGLE) {
return; return;
} }
super.onAdd(pokemon);
this.moveId = move.move; this.moveId = move.move;
globalScene.queueMessage( globalScene.queueMessage(