From 82b6c48497aa0126cc56f2923f9a0289211d8a9e Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Tue, 11 Apr 2023 18:24:36 -0400 Subject: [PATCH] fix: process roms in consistent order (#2696) --- OTRExporter/rom_chooser.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/OTRExporter/rom_chooser.py b/OTRExporter/rom_chooser.py index bdee088be..fa5fcc281 100644 --- a/OTRExporter/rom_chooser.py +++ b/OTRExporter/rom_chooser.py @@ -18,17 +18,14 @@ def chooseROM(verbose=False, non_interactive=False): return roms if non_interactive: - romsToExtract = [] - foundMq = False - foundOot = False + mq_rom = None + non_mq_rom = None for rom in roms: - if rom.isMq and not foundMq: - romsToExtract.append(rom) - foundMq = True - elif not rom.isMq and not foundOot: - romsToExtract.append(rom) - foundOot = True - return romsToExtract + if rom.isMq and mq_rom is None: + mq_rom = rom + elif not rom.isMq and non_mq_rom is None: + non_mq_rom = rom + return [rom for rom in [non_mq_rom, mq_rom] if rom is not None] print(f"{len(roms)} roms found, please select one by pressing 1-{len(roms)}") print()