fix some bugs

main
ColdWindScholar 2023-11-11 06:52:29 +08:00
parent e72de6acdd
commit a495374352
1 changed files with 1 additions and 2 deletions

View File

@ -136,12 +136,11 @@ class sdat2img:
with open(self.TRANSFER_LIST_FILE, 'r') as trans_list:
# First line in transfer list is the version number
# Second line in transfer list is the total number of blocks we expect to write
if (version := int(trans_list.readline())) >= 2:
if (version := int(trans_list.readline())) >= 2 and (new_blocks := int(trans_list.readline())):
# Third line is how many stash entries are needed simultaneously
trans_list.readline()
# Fourth line is the maximum number of blocks that will be stashed simultaneously
trans_list.readline()
new_blocks = int(trans_list.readline())
# Subsequent lines are all individual transfer commands
yield version
yield new_blocks