Always check for beatability, ignoring playthrough setting
This commit is contained in:
parent
975a40e093
commit
c24a376dd0
10
Main.py
10
Main.py
|
@ -342,6 +342,7 @@ def main(args, seed=None):
|
||||||
|
|
||||||
pool = concurrent.futures.ThreadPoolExecutor()
|
pool = concurrent.futures.ThreadPoolExecutor()
|
||||||
multidata_task = None
|
multidata_task = None
|
||||||
|
check_beatability_task = pool.submit(world.can_beat_game)
|
||||||
if not args.suppress_rom:
|
if not args.suppress_rom:
|
||||||
|
|
||||||
rom_futures = []
|
rom_futures = []
|
||||||
|
@ -425,14 +426,15 @@ def main(args, seed=None):
|
||||||
"precollected_items": precollected_items,
|
"precollected_items": precollected_items,
|
||||||
"version": _version_tuple,
|
"version": _version_tuple,
|
||||||
"tags": multidatatags,
|
"tags": multidatatags,
|
||||||
"minimum_versions" : minimum_versions
|
"minimum_versions": minimum_versions
|
||||||
}).encode("utf-8"), 9)
|
}).encode("utf-8"), 9)
|
||||||
|
|
||||||
with open(output_path('%s.multidata' % outfilebase), 'wb') as f:
|
with open(output_path('%s.multidata' % outfilebase), 'wb') as f:
|
||||||
f.write(multidata)
|
f.write(multidata)
|
||||||
|
|
||||||
multidata_task = pool.submit(write_multidata, rom_futures)
|
multidata_task = pool.submit(write_multidata, rom_futures)
|
||||||
|
if not check_beatability_task.result():
|
||||||
|
raise Exception("Game appears unbeatable. Aborting.")
|
||||||
if not args.skip_playthrough:
|
if not args.skip_playthrough:
|
||||||
logger.info('Calculating playthrough.')
|
logger.info('Calculating playthrough.')
|
||||||
create_playthrough(world)
|
create_playthrough(world)
|
||||||
|
@ -578,10 +580,6 @@ def create_playthrough(world):
|
||||||
old_world = world
|
old_world = world
|
||||||
world = copy_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
|
# get locations containing progress items
|
||||||
prog_locations = [location for location in world.get_filled_locations() if location.item.advancement]
|
prog_locations = [location for location in world.get_filled_locations() if location.item.advancement]
|
||||||
state_cache = [None]
|
state_cache = [None]
|
||||||
|
|
Loading…
Reference in New Issue