combiner fixes
This commit is contained in:
parent
f2a516b5f0
commit
eaf50c3a26
@ -248,15 +248,24 @@ function Vbox(args) {
|
|||||||
function onClick(e) {
|
function onClick(e) {
|
||||||
if (vboxSelecting) clearVboxSelected();
|
if (vboxSelecting) clearVboxSelected();
|
||||||
if (reclaiming) return sendVboxReclaim(i);
|
if (reclaiming) return sendVboxReclaim(i);
|
||||||
|
|
||||||
|
// 4 things selected
|
||||||
if (combiner.length > 2) return combinerChange([i]);
|
if (combiner.length > 2) return combinerChange([i]);
|
||||||
|
|
||||||
|
// removing
|
||||||
const combinerIndex = combiner.indexOf(i);
|
const combinerIndex = combiner.indexOf(i);
|
||||||
if (combinerIndex > -1) {
|
if (combinerIndex > -1) {
|
||||||
return combinerChange(without(combiner, i));
|
return combinerChange(without(combiner, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
combiner.push(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);
|
return combinerChange(combiner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user