From 73f5d51dd2ed74938ed83afc8b6d7ef2d0940127 Mon Sep 17 00:00:00 2001 From: RedstonewolfX <108761527+RedstonewolfX@users.noreply.github.com> Date: Sat, 10 Aug 2024 22:21:31 -0400 Subject: [PATCH] Mark logging errors Replaces names when the game tries to log something incorrectly (I.E. logging a player action for an enemy) --- src/logger.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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) + ")"