From 88980fb3b6fbde13ffea43e5ac5680959a4df766 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Wed, 3 Feb 2021 14:26:00 +0100 Subject: [PATCH] Make playthrough text deterministic, by sorting alphabetically --- Main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Main.py b/Main.py index 7443a8b4..3602f9c7 100644 --- a/Main.py +++ b/Main.py @@ -669,7 +669,7 @@ def create_playthrough(world): while required_locations: state.sweep_for_events(key_only=True) - sphere = list(filter(state.can_reach, required_locations)) + sphere = set(filter(state.can_reach, required_locations)) for location in sphere: required_locations.remove(location) @@ -705,6 +705,7 @@ def create_playthrough(world): old_world.spoiler.paths[str(world.get_region('Inverted Big Bomb Shop', player))] = get_path(state, world.get_region('Inverted Big Bomb Shop', player)) # we can finally output our playthrough - old_world.spoiler.playthrough = {"0": {str(item) for item in world.precollected_items if item.advancement}} + old_world.spoiler.playthrough = {"0": sorted([str(item) for item in world.precollected_items if item.advancement])} + for i, sphere in enumerate(collection_spheres): - old_world.spoiler.playthrough[str(i + 1)] = {str(location): str(location.item) for location in sphere} + old_world.spoiler.playthrough[str(i + 1)] = {str(location): str(location.item) for location in sorted(sphere)}