Skip to content

Commit

Permalink
SA2B: Fix KeyError on Unexpected Characters in Slot Names (#2571)
Browse files Browse the repository at this point in the history
There were no safeguards on characters being used as keys into a conversion dict. Now there are.
  • Loading branch information
PoryGone authored Dec 8, 2023
1 parent abfc2dd commit 9351fb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion worlds/sa2b/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def generate_chao_name_data(self) -> typing.Dict[int, int]:
for name in name_list_base:
for char_idx in range(7):
if char_idx < len(name):
name_list_s.append(chao_name_conversion[name[char_idx]])
name_list_s.append(chao_name_conversion.get(name[char_idx], 0x5F))
else:
name_list_s.append(0x00)

Expand Down

0 comments on commit 9351fb4

Please sign in to comment.