Skip to content

Commit

Permalink
sort for determinism
Browse files Browse the repository at this point in the history
  • Loading branch information
EnvyDragon committed Aug 5, 2024
1 parent f7c981f commit 91668cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion worlds/sc2/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,8 @@ def get_excluded_missions(world: 'SC2World') -> Set[SC2Mission]:
]
while len(swaps) > 0:
curr = swaps[0]
variants = list([mission for mission in swaps if mission.map_file == curr.map_file])
variants = [mission for mission in swaps if mission.map_file == curr.map_file]
variants.sort(key=lambda mission: mission.id)
swaps = [mission for mission in swaps if mission not in variants]
if len(variants) > 1:
variants.pop(world.random.randint(0, len(variants)-1))
Expand Down

0 comments on commit 91668cd

Please sign in to comment.