From ead7c117a8cbb709c73b93f7f7014ac60e37dcf7 Mon Sep 17 00:00:00 2001 From: compiling <8335770+compiling@users.noreply.github.com> Date: Sun, 12 Jan 2020 21:20:14 +1100 Subject: [PATCH] Skip the playthrough when run from the gui, if the spoiler isn't being created. --- Gui.py | 1 + Main.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Gui.py b/Gui.py index 143b2a15..63dc87c9 100755 --- a/Gui.py +++ b/Gui.py @@ -459,6 +459,7 @@ def guiMain(args=None): guiargs.heartcolor = heartcolorVar.get() guiargs.fastmenu = fastMenuVar.get() guiargs.create_spoiler = bool(createSpoilerVar.get()) + guiargs.skip_playthrough = not bool(createSpoilerVar.get()) guiargs.suppress_rom = bool(suppressRomVar.get()) guiargs.openpyramid = bool(openpyramidVar.get()) guiargs.mapshuffle = bool(mapshuffleVar.get()) diff --git a/Main.py b/Main.py index 1d0f601d..1b0bcde9 100644 --- a/Main.py +++ b/Main.py @@ -209,6 +209,10 @@ def main(args, seed=None): if args.create_spoiler and not args.jsonout: world.spoiler.to_file(output_path('%s_Spoiler.txt' % outfilebase)) + # if we only check for beatable, we can do this sanity check first before writing down spheres + if not world.can_beat_game(): + raise RuntimeError('Cannot beat game. Something went terribly wrong here!') + if not args.skip_playthrough: logger.info('Calculating playthrough.') create_playthrough(world) @@ -350,10 +354,6 @@ def create_playthrough(world): old_world = world world = copy_world(world) - # if we only check for beatable, we can do this sanity check first before writing down spheres - if not world.can_beat_game(): - raise RuntimeError('Cannot beat game. Something went terribly wrong here!') - # get locations containing progress items prog_locations = [location for location in world.get_filled_locations() if location.item.advancement] state_cache = [None]