aboutsummaryrefslogtreecommitdiff
path: root/internal/game/production_engine.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/production_engine.go')
-rw-r--r--internal/game/production_engine.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/game/production_engine.go b/internal/game/production_engine.go
index ddada6b..89d6f55 100644
--- a/internal/game/production_engine.go
+++ b/internal/game/production_engine.go
@@ -128,7 +128,15 @@ func (g *Game) startProductionFromItem(sess *net.Session, p *player.Player, item
return
}
- if craft.Type == "combine" {
+ // Normalize the empty craft type to "combine" here as well as in the
+ // craft index: an omitted `type:` is combine, but the index's normalized
+ // key was never written back to the recipe, so the literal comparison
+ // below would fall through to the production path with an empty key.
+ craftType := craft.Type
+ if craftType == "" {
+ craftType = "combine"
+ }
+ if craftType == "combine" {
g.startCombine(sess, p, item, craft, count)
return
}
@@ -140,7 +148,7 @@ func (g *Game) startProductionFromItem(sess *net.Session, p *player.Player, item
cKey := craft.Subtype
if cKey == "" {
- cKey = craft.Type
+ cKey = craftType
}
info, ok := productionTypes[cKey]