Fix getBattlerIndex for enemyPokemon

This commit is contained in:
Sirz Benjie 2025-08-19 18:04:45 -05:00
parent f7cb01011c
commit bbd6eb9579
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -6941,7 +6941,11 @@ export class EnemyPokemon extends Pokemon {
return globalScene.getEnemyField().indexOf(this);
}
public getBattlerIndex(): Exclude<BattlerIndex, BattlerIndex.ATTACKER> {
public getBattlerIndex(): BattlerIndex {
const fieldIndex = this.getFieldIndex();
if (fieldIndex === -1) {
return BattlerIndex.ATTACKER;
}
return BattlerIndex.ENEMY + this.getFieldIndex();
}