Skip to content

Commit

Permalink
fix main gyro crash
Browse files Browse the repository at this point in the history
  • Loading branch information
duncathan committed Jul 30, 2023
1 parent fff4067 commit 87083f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/open_prime_rando/echoes/small_randomizations/rubiks.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ def randomize_rubiks_puzzles(editor: PatcherEditor, rng: random.Random):
for color in COLORS.values():
txtr_id = editor.add_file(color.txtr_name, color.txtr)

cmdl = editor.get_file(color.cmdl, Cmdl)
# FIXME: we can't use get_file or else the dependencies break
cmdl = editor.get_parsed_asset(color.cmdl, type_hint=Cmdl)
file_ids = cmdl.raw.material_sets[0].texture_file_ids
old_txtr = file_ids.index(color.old_txtr)
file_ids[old_txtr] = txtr_id
editor.replace_asset(color.cmdl, cmdl)
# FIXME: we should not need to do this manually
editor._cached_dependencies.pop(color.cmdl, None)

for puzzle_name, cubes in RUBIKS_CUBES.items():
solution = [
Expand Down

0 comments on commit 87083f6

Please sign in to comment.