From 67e6896d5ec2dce7bb014fdfdd4ee103c050e992 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 6 Jul 2021 01:02:15 +0100 Subject: [PATCH] script: Consistently use lower_treat_pinned PieceInfo.pinned is not the same, and the algorithm needs a coherent idea of what counts. Signed-off-by: Ian Jackson --- templates/script.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/script.ts b/templates/script.ts index 4e332338..e90d0772 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -671,8 +671,9 @@ function lower_pieces(targets_todo: LowerTodoList): } let p = pieces[piece]!; + let p_pinned = lower_treat_pinned(p); if (bottommost_unpinned === null) { // state A - if (!p.pinned) { + if (!p_pinned) { console.log('LOWER WALK', piece, 'STATE A -> Z'); bottommost_unpinned = { p, piece }; } else { @@ -683,7 +684,7 @@ function lower_pieces(targets_todo: LowerTodoList): } // state B - if (p.pinned) { + if (p_pinned) { console.log('LOWER WALK', piece, 'STATE B MIS-STACKED'); tomove_misstacked.push({ p, piece }); } else { -- 2.30.2