Skip to content

Commit

Permalink
Handle unrecognized recipe names
Browse files Browse the repository at this point in the history
  • Loading branch information
mitaa committed Sep 17, 2024
1 parent 0218a6f commit b4410dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/production_planner/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,11 @@ def node_constructor(loader, node):
if data["recipe"] in prod.recipe_map:
node.recipe = prod.recipe_map[data["recipe"]]
else:
node.recipe = prod.recipe_map["Alternate: " + data["recipe"]]
# TODO: do not fail on unrecognized recipe
alternate = "Alternate: " + data["recipe"]
if alternate in prod.recipe_map:
node.recipe = prod.recipe_map["Alternate: " + data["recipe"]]
else:
node.recipe = Recipe(f"! { data['recipe'] }", 60, [], [], False)
node.update()
return node

Expand Down

0 comments on commit b4410dc

Please sign in to comment.