diff --git a/src/logger.ts b/src/logger.ts index 6581bbcc496..f24d1896ae1 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -340,6 +340,9 @@ export function playerPokeName(scene: BattleScene, index: integer | Pokemon | Pl return scene.getParty()[index].name + " (Slot " + (index + 1) + ")" return scene.getParty()[index].name } + if (!index.isPlayer()) { + return "[Not a player Pokemon??]" + } //console.log(index.name, species, dupeSpecies) if (dupeSpecies.includes(index.name)) return index.name + " (Slot " + (scene.getParty().indexOf(index as PlayerPokemon) + 1) + ")" @@ -369,6 +372,9 @@ export function enemyPokeName(scene: BattleScene, index: integer | Pokemon | Ene return scene.getEnemyParty()[index].name + " (Slot " + (index + 1) + ")" return scene.getEnemyParty()[index].name } + if (index.isPlayer()) { + return "[Not an enemy Pokemon??]" + } //console.log(index.name, species, dupeSpecies) if (dupeSpecies.includes(index.name)) return index.name + " (Slot " + (scene.getEnemyParty().indexOf(index as EnemyPokemon) + 1) + ")"