Skip to content

Commit 4da9cdd

Browse files
authored
CV64: Fix items with weird characters landing on Renon's shop crashing (#3305)
1 parent 6576b06 commit 4da9cdd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

worlds/cv64/text.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def cv64_string_to_bytearray(cv64text: str, a_advance: bool = False, append_end:
3131
if char in cv64_char_dict:
3232
text_bytes.extend([0x00, cv64_char_dict[char][0]])
3333
else:
34-
text_bytes.extend([0x00, 0x41])
34+
text_bytes.extend([0x00, 0x21])
3535

3636
if a_advance:
3737
text_bytes.extend([0xA3, 0x00])
@@ -45,7 +45,10 @@ def cv64_text_truncate(cv64text: str, textbox_len_limit: int) -> str:
4545
line_len = 0
4646

4747
for i in range(len(cv64text)):
48-
line_len += cv64_char_dict[cv64text[i]][1]
48+
if cv64text[i] in cv64_char_dict:
49+
line_len += cv64_char_dict[cv64text[i]][1]
50+
else:
51+
line_len += 5
4952

5053
if line_len > textbox_len_limit:
5154
return cv64text[0x00:i]

0 commit comments

Comments
 (0)