Factorio: Fix random rocket-silo recipe unable to pick ingredients where recipe name != product name

This commit is contained in:
Fabian Dill 2021-08-31 01:47:00 +02:00
parent df037c54ff
commit 321569c542
1 changed files with 1 additions and 4 deletions

View File

@ -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