From 321569c542b9893b0b1f5a27d208d2090200d18e Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 31 Aug 2021 01:47:00 +0200 Subject: [PATCH] Factorio: Fix random rocket-silo recipe unable to pick ingredients where recipe name != product name --- worlds/factorio/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/worlds/factorio/__init__.py b/worlds/factorio/__init__.py index c5ca837f..6c4bce45 100644 --- a/worlds/factorio/__init__.py +++ b/worlds/factorio/__init__.py @@ -184,10 +184,7 @@ class Factorio(World): max_energy = remaining_energy * 0.75 min_energy = (remaining_energy - max_energy) / remaining_num_ingredients ingredient = pool.pop() - if ingredient not in recipes: - logging.warning(f"missing recipe for {ingredient}") - continue - ingredient_recipe = recipes[ingredient] + ingredient_recipe = min(all_product_sources[ingredient], key=lambda recipe: recipe.rel_cost) ingredient_raw = sum((count for ingredient, count in ingredient_recipe.base_cost.items())) ingredient_energy = ingredient_recipe.total_energy min_num_raw = min_raw/ingredient_raw