fixed bug with not being able to use fluid barrels as last ingredient in balanced recipes.
fluid barrels don't have a direct recipe name to ingredient name match, but instead recipe name is fill-ingredient.
This commit is contained in:
parent
744b12345a
commit
1a63ed970a
|
@ -246,10 +246,12 @@ class Factorio(World):
|
||||||
pool = fallback_pool
|
pool = fallback_pool
|
||||||
while remaining_num_ingredients > 0 and pool:
|
while remaining_num_ingredients > 0 and pool:
|
||||||
ingredient = pool.pop()
|
ingredient = pool.pop()
|
||||||
if ingredient not in recipes:
|
ingredient_recipe = recipes.get(ingredient, None)
|
||||||
|
if not ingredient_recipe and ingredient.endswith("-barrel"):
|
||||||
|
ingredient_recipe = recipes.get(f"fill-{ingredient}", None)
|
||||||
|
if not ingredient_recipe:
|
||||||
logging.warning(f"missing recipe for {ingredient}")
|
logging.warning(f"missing recipe for {ingredient}")
|
||||||
continue
|
continue
|
||||||
ingredient_recipe = recipes[ingredient]
|
|
||||||
ingredient_raw = sum((count for ingredient, count in ingredient_recipe.base_cost.items()))
|
ingredient_raw = sum((count for ingredient, count in ingredient_recipe.base_cost.items()))
|
||||||
ingredient_energy = ingredient_recipe.total_energy
|
ingredient_energy = ingredient_recipe.total_energy
|
||||||
num_raw = remaining_raw / ingredient_raw / remaining_num_ingredients
|
num_raw = remaining_raw / ingredient_raw / remaining_num_ingredients
|
||||||
|
|
Loading…
Reference in New Issue