Skip to content

Commit 81c8e5e

Browse files
committed
Fixed an crash when short seed numbers are used
1 parent a6836cf commit 81c8e5e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dwrandomizer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,10 @@ def update_title_screen(self, seed, flags):
685685
new_text += blank_line
686686

687687
needed_bytes = len(self.title_screen_text) - len(new_text) - 4
688+
if needed_bytes > 31: # current data is too short...
689+
new_text = new_text[:-len(blank_line)] + (b'\x5f' * 32 + b'\xfc')
690+
needed_bytes = len(self.title_screen_text) - len(new_text) - 4
691+
688692
new_text += b'\x5f' * needed_bytes + padding(32 - needed_bytes) + b'\xfc'
689693
new_text = new_text.replace(b'\x47', b'\x61').replace(b'\x49', b'\x63')
690694

0 commit comments

Comments
 (0)