chiark / gitweb /
script: Consistently use lower_treat_pinned
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 6 Jul 2021 00:02:15 +0000 (01:02 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 6 Jul 2021 00:11:09 +0000 (01:11 +0100)
PieceInfo.pinned is not the same, and the algorithm needs a coherent
idea of what counts.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts

index 4e33233804e8237d8fad53a2d7ec8c6e9531d15e..e90d077232ed405b01dc427908b69c4ce4fc57b9 100644 (file)
@@ -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 {