From 3ea7f1cb0359e6a89193255eba9dea25cfe8f8d4 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 11 Jun 2021 20:18:28 +0200 Subject: [PATCH] Factorio Funnels: only sort current funnel, not all funnels --- Main.py | 1 - worlds/factorio/Shapes.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Main.py b/Main.py index 874cac83..c35f5b9d 100644 --- a/Main.py +++ b/Main.py @@ -1,4 +1,3 @@ -import copy from itertools import zip_longest import logging import os diff --git a/worlds/factorio/Shapes.py b/worlds/factorio/Shapes.py index 617ba163..481b64cf 100644 --- a/worlds/factorio/Shapes.py +++ b/worlds/factorio/Shapes.py @@ -173,15 +173,14 @@ def get_shapes(factorio_world) -> Dict[str, List[str]]: elif layout in funnel_layers: slice_size = funnel_slice_sizes[layout] - world.random.shuffle(tech_names) - tech_names.sort(key=lambda tech_name: len(custom_technologies[tech_name].get_prior_technologies())) while len(tech_names) > slice_size: tech_names = tech_names[slice_size:] current_tech_names = tech_names[:slice_size] layer_size = funnel_layers[layout] previous_slice = [] + current_tech_names.sort(key=lambda tech_name: len(custom_technologies[tech_name].get_prior_technologies())) for layer in range(funnel_layers[layout]): slice = current_tech_names[:layer_size] current_tech_names = current_tech_names[layer_size:]