diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index 3257c87b..5a13b404 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -249,13 +249,14 @@ function Vbox(args) { const combinerItems = combiner.map(j => vbox.bound[j]); const comboHighlight = combinerItems.length > 0 && itemInfo.combos.some(combo => { - if (combo.components.includes(v) && combinerItems.every(c => combo.components.includes(c))) { + if (combo.components.includes(v)) { return combinerItems.every(c => { - if (c !== v) return true; + if (!combo.components.includes(c)) return false; const comboCount = countBy(combo.components, co => co); - const combinerCounts = countBy(combinerItems, co => co); - if (comboCount[c] > combinerCounts[c]) return true; - return false; + const combinerCount = countBy(combinerItems, co => co); + if (combinerCount[c] > comboCount[c]) return false; + if (c === v && combinerCount[c] + 1 > comboCount[c]) return false; + return true; }); } return false; }) ? 'combo-border' : ''; @@ -275,10 +276,6 @@ function Vbox(args) { combiner.push(i); - // invalid combo - const combinerItems = combiner.map(j => vbox.bound[j]); - const combinerCounts = countBy(combinerItems, c => c); - if (!comboHighlight) { return combinerChange([i]); }