SkyTemple/skytemple

monster string provider: IndexError: list index out of range

sentry-io opened this issue · 1 comments

Sentry Issue: SKYTEMPLE-1CZ

IndexError: list index out of range
  File "controller\main.py", line 343, in on_file_opened
  File "module\monster\module.py", line 112, in load_tree_items
  File "core\string_provider.py", line 105, in get_value

Some more details from someone who recently experienced this issue: ExpandPokeList is applied.

Seems like SkyTemple tries to pull the pokémon name from the string list, and the error shows up when the list is overflown.
Responsible line of code:

return model.strings[self.get_index(string_type, index)]

I don't know how pokémon names are handled with ExpandPokeList, but it's unlikely they are just pulled from the string list like this. Why does SkyTemple try to read them from the string list when the patch is applied?