From 7a15a5d70004b28bf2a710fa0f536af2446e5b17 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 5 Oct 2026 17:49:48 -0400 Subject: fix: production multi-step recipes, drop-weight validation, journal versioning --- internal/game/act_combine.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'internal/game/act_combine.go') diff --git a/internal/game/act_combine.go b/internal/game/act_combine.go index 701aaec..d7aed04 100644 --- a/internal/game/act_combine.go +++ b/internal/game/act_combine.go @@ -8,7 +8,7 @@ import ( "thehouseoficarus/internal/player" ) -func (g *Game) startCombine(sess *net.Session, p *player.Player, item *item.ItemDef, craft *item.CraftDef, count int) { +func (g *Game) startCombine(sess *net.Session, p *player.Player, item *item.ItemDef, craft *item.CraftDef, count int, craftIndex int) { g.cancelAction(p) g.cancelBgAction(p) @@ -33,6 +33,7 @@ func (g *Game) startCombine(sess *net.Session, p *player.Player, item *item.Item TargetName: outputName, Data: &behavior.CombineData{ ItemID: item.ID, + CraftIndex: craftIndex, Phase: 0, StepIndex: 0, Remaining: count, @@ -72,7 +73,11 @@ func (g *Game) advanceCombine(sess *net.Session, p *player.Player) { g.cancelAction(p) return } - craft := item.FirstCraft() + idx := d.CraftIndex + if idx < 0 || idx >= len(item.Craft) { + idx = 0 + } + craft := &item.Craft[idx] switch d.Phase { case 0: @@ -127,7 +132,7 @@ func (g *Game) advanceCombine(sess *net.Session, p *player.Player) { // Byproducts must be collected BEFORE consumption: the resolver maps // each ingredient entry to the alternative actually being consumed // (bucket vs jug of water), which requires the items still present. - byproducts := g.collectByproducts(p, item) + byproducts := g.collectByproducts(p, craft) hasItem := craftConsumedHasItem(craft, p.CountItem, p.HasItem) if !consumeIngredients(craft, p.CountItem, p.RemoveItem) { -- cgit v1.2.3