Mark logging errors

Replaces names when the game tries to log something incorrectly (I.E. logging a player action for an enemy)
This commit is contained in:
RedstonewolfX 2024-08-10 22:21:31 -04:00
parent a6ca7e38a4
commit 73f5d51dd2

View File

@ -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 + " (Slot " + (index + 1) + ")"
return scene.getParty()[index].name return scene.getParty()[index].name
} }
if (!index.isPlayer()) {
return "[Not a player Pokemon??]"
}
//console.log(index.name, species, dupeSpecies) //console.log(index.name, species, dupeSpecies)
if (dupeSpecies.includes(index.name)) if (dupeSpecies.includes(index.name))
return index.name + " (Slot " + (scene.getParty().indexOf(index as PlayerPokemon) + 1) + ")" 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 + " (Slot " + (index + 1) + ")"
return scene.getEnemyParty()[index].name return scene.getEnemyParty()[index].name
} }
if (index.isPlayer()) {
return "[Not an enemy Pokemon??]"
}
//console.log(index.name, species, dupeSpecies) //console.log(index.name, species, dupeSpecies)
if (dupeSpecies.includes(index.name)) if (dupeSpecies.includes(index.name))
return index.name + " (Slot " + (scene.getEnemyParty().indexOf(index as EnemyPokemon) + 1) + ")" return index.name + " (Slot " + (scene.getEnemyParty().indexOf(index as EnemyPokemon) + 1) + ")"