aboutsummaryrefslogtreecommitdiff
path: root/internal/game/production_index.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/production_index.go')
-rw-r--r--internal/game/production_index.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/game/production_index.go b/internal/game/production_index.go
index 22e944e..4ded387 100644
--- a/internal/game/production_index.go
+++ b/internal/game/production_index.go
@@ -229,6 +229,12 @@ func planIngredients(c *item.CraftDef, countItem func(string) int) []consumption
if c == nil {
return nil
}
+ // A craft with no ingredient entries is not "always satisfied": it would
+ // consume nothing and loop forever producing output. Treat it as
+ // unsatisfiable; the validator also rejects it.
+ if len(c.Ingredients) == 0 {
+ return nil
+ }
reserved := make(map[string]int, len(c.Ingredients))
plan := make([]consumption, 0, len(c.Ingredients))
for i := range c.Ingredients {