scripts: prevent infinite loop when preserved block can't be found (#1946)

This commit is contained in:
Tyler Wilding
2022-10-08 21:53:23 -04:00
committed by GitHub
parent 405a144815
commit 1d1ea907c9
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -32838,7 +32838,7 @@
;; elevator ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; +++elevator-flags
;; +++elevator:elevator-flags
(defenum elevator-flags
:type uint64
:bitfield #t
@@ -32851,7 +32851,7 @@
(elevator-flags-6)
(elevator-flags-7)
)
;; ---elevator-flags
;; ---elevator:elevator-flags
(deftype elevator-params (structure)
((xz-threshold float :offset-assert 0)
@@ -71,8 +71,10 @@ def update_all_blocks(game_name, block_dict):
final_lines.append(line)
block_id = line.split(";; +++")[1]
# Look to see if we actually have that block
found_block = False
for block in blocks:
if block.block_id == block_id:
found_block = True
# if we found the block, write the data, then proceed ahead until the end
for block_line in block.data:
final_lines.append(block_line)
@@ -84,6 +86,8 @@ def update_all_blocks(game_name, block_dict):
i = i + 1
break
break
if not found_block:
i = i + 1
else:
final_lines.append(line)
i = i + 1