SA2B: Fix KeyError on Unexpected Characters in Slot Names (#2571)

There were no safeguards on characters being used as keys into a conversion dict. Now there are.
This commit is contained in:
PoryGone
2023-12-08 01:17:12 -05:00
committed by GitHub
parent abfc2ddfed
commit 9351fb45ca

View File

@@ -619,7 +619,7 @@ class SA2BWorld(World):
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)