From 75a735d589311698ae2079c8e312fe2dfa985921 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 25 Jun 2026 20:35:20 +0200 Subject: [PATCH] feat(suitbuilder): apply CD-tier filter in loadItems (before domination) Co-Authored-By: Claude Opus 4.8 --- go-services/inventory-go/suit_solver.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/go-services/inventory-go/suit_solver.go b/go-services/inventory-go/suit_solver.go index 42b82618..9023b000 100644 --- a/go-services/inventory-go/suit_solver.go +++ b/go-services/inventory-go/suit_solver.go @@ -25,6 +25,7 @@ type Solver struct { bestSuitItemCount int highestArmorCount int armorBucketsItems int + allowedCD map[int]bool // nil == no CD filter (default / all tiers) lockedSetCounts map[int]int lockedSpells map[string]bool @@ -53,6 +54,7 @@ func newSolver(s *Server, c SearchConstraints, emit func(string, map[string]any) } // Required spells register first, so they always get the low bits. sv.neededSpellBitmap = sv.spellIndex.getBitmap(c.RequiredSpells) + sv.allowedCD = allowedCritSet(c.AllowedCritDamage) return sv } @@ -259,6 +261,10 @@ func (sv *Solver) loadItems(ctx context.Context) ([]*SuitItem, error) { } } + // Drop armor whose CD tier is disallowed BEFORE domination, so a CD2 piece + // can't surpass-and-remove an allowed CD1 piece we'd then exclude. + items = filterArmorByCD(items, sv.allowedCD) + filtered := removeSurpassedItems(items) jewelryFallback := map[string]bool{"Ring": true, "Bracelet": true, "Jewelry": true, "Necklace": true, "Amulet": true}