From fea2cc6839ec3ee17940a2dea69622dc6f4deabf Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 16 Sep 2026 21:35:55 -0400 Subject: fix: unify crafting ingredient resolution; fix superheat alternatives, quantity gates, and dropped combine byproducts --- internal/game/act_combine.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'internal/game/act_combine.go') diff --git a/internal/game/act_combine.go b/internal/game/act_combine.go index 26d85c6..bc9b6de 100644 --- a/internal/game/act_combine.go +++ b/internal/game/act_combine.go @@ -100,7 +100,12 @@ func (g *Game) advanceCombine(sess *net.Session, p *player.Player) { return } - consumeIngredients(craft, p.HasItem, p.RemoveItem) + // 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) + + consumeIngredients(craft, p.CountItem, p.RemoveItem) outputQty := craft.OutputQty if outputQty <= 0 { @@ -129,6 +134,14 @@ func (g *Game) advanceCombine(sess *net.Session, p *player.Player) { p.SetInvSlot(freeSlot, &player.InventorySlot{ItemID: item.ID, Quantity: outputQty}) } + // Return the empty containers (and any other byproducts) alongside + // the output; without this, combine crafts silently discarded them. + for _, bp := range byproducts { + if slot := p.FirstFreeSlot(); slot >= 0 { + p.SetInvSlot(slot, &player.InventorySlot{ItemID: bp, Quantity: 1}) + } + } + g.saveCharacter(p) if d.Remaining > 0 { -- cgit v1.2.3