Skip the playthrough when run from the gui, if the spoiler isn't being created.

This commit is contained in:
compiling
2020-01-12 21:20:14 +11:00
parent d35c5f5d68
commit ead7c117a8
2 changed files with 5 additions and 4 deletions

1
Gui.py
View File

@@ -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())

View File

@@ -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]