From d18eba4df83fadfd0fbbaf7efd3c8c6f31acb6b9 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Thu, 7 Mar 2024 08:23:21 -0500 Subject: [PATCH] Fix Pickup causing crash outside of battle --- src/data/ability.ts | 2 +- src/data/battler-tags.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index a49f4ff54b0..a23ed4c1dd0 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1283,7 +1283,7 @@ function canApplyAttr(pokemon: Pokemon, attr: AbAttr): boolean { } function queueShowAbility(pokemon: Pokemon): void { - pokemon.scene.unshiftPhase(new ShowAbilityPhase(pokemon.scene, pokemon.getBattlerIndex())); + pokemon.scene.unshiftPhase(new ShowAbilityPhase(pokemon.scene, pokemon.id)); pokemon.scene.clearPhaseQueueSplice(); } diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 33fda240557..8ed038c2956 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -640,7 +640,7 @@ export class TruantTag extends AbilityBattlerTag { if (lastMove && lastMove.move !== Moves.NONE) { (pokemon.scene.getCurrentPhase() as MovePhase).cancel(); - pokemon.scene.unshiftPhase(new ShowAbilityPhase(pokemon.scene, pokemon.getBattlerIndex())); + pokemon.scene.unshiftPhase(new ShowAbilityPhase(pokemon.scene, pokemon.id)); pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' is\nloafing around!')); }