combiner fixes
This commit is contained in:
parent
f2a516b5f0
commit
eaf50c3a26
@ -248,15 +248,24 @@ function Vbox(args) {
|
||||
function onClick(e) {
|
||||
if (vboxSelecting) clearVboxSelected();
|
||||
if (reclaiming) return sendVboxReclaim(i);
|
||||
|
||||
// 4 things selected
|
||||
if (combiner.length > 2) return combinerChange([i]);
|
||||
|
||||
// removing
|
||||
const combinerIndex = combiner.indexOf(i);
|
||||
if (combinerIndex > -1) {
|
||||
return combinerChange(without(combiner, i));
|
||||
}
|
||||
|
||||
|
||||
combiner.push(i);
|
||||
|
||||
// invalid combo
|
||||
const combinerItems = combiner.map(j => vbox.bound[j]);
|
||||
if (!itemInfo.combos.some(combo => combinerItems.every(c => combo.components.includes(c)))) {
|
||||
return combinerChange([i]);
|
||||
}
|
||||
|
||||
return combinerChange(combiner);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user