Skip to content

Commit 97a22ea

Browse files
authored
Fix Input Ordering for Expandable Join + Math
1 parent 75db9d4 commit 97a22ea

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/compiler/irgen.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,10 @@ class ScriptTreeGenerator {
451451
};
452452
case 'operator_expandableMath': {
453453
const menuOperators = block.mutation.menuvalues;
454-
const inputs = Object.values(block.inputs);
454+
const inputCount = Number(block.mutation.inputcount);
455455
const operations = [];
456-
for (var i = 0; i < inputs.length; i++) {
457-
const input = inputs[i];
456+
for (let i = 1; i <= inputCount; i++) {
457+
const input = block.inputs["NUM" + i];
458458
if (input.block == null) delete block.inputs[input.name];
459459
else operations.push([
460460
this.descendInputOfBlock(block, input.name),
@@ -487,7 +487,9 @@ class ScriptTreeGenerator {
487487
case "operators_expandablejoininputs":
488488
case "operator_expandablejoininputs": {
489489
const strings = [];
490-
for (const input of Object.values(block.inputs)) {
490+
const inputCount = Number(block.mutation.inputcount);
491+
for (let i = 1; i <= inputCount; i++) {
492+
const input = block.inputs["INPUT" + i];
491493
if (input.block == null) delete block.inputs[input.name];
492494
else strings.push(this.descendInputOfBlock(block, input.name));
493495
}

0 commit comments

Comments
 (0)