From bbd6eb95798e3e9632562088c39f91ca7a945371 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Tue, 19 Aug 2025 18:04:45 -0500 Subject: [PATCH] Fix getBattlerIndex for enemyPokemon --- src/field/pokemon.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index c0e3d85a2eb..a1e542fdb02 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -6941,7 +6941,11 @@ export class EnemyPokemon extends Pokemon { return globalScene.getEnemyField().indexOf(this); } - public getBattlerIndex(): Exclude { + public getBattlerIndex(): BattlerIndex { + const fieldIndex = this.getFieldIndex(); + if (fieldIndex === -1) { + return BattlerIndex.ATTACKER; + } return BattlerIndex.ENEMY + this.getFieldIndex(); }