chiark / gitweb /
lowering: Only do clashing Z heavy when needed
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 19 Jul 2021 02:23:20 +0000 (03:23 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 19 Jul 2021 23:45:13 +0000 (00:45 +0100)
If there are no pieces Q to insert, we con't need to worry about this,
because it'll just be an empty ignored plan entry.

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

index 6f07040925d85f43fe9683e26b32320cfa934e67..1a069962a3165285dad7b9efc65285cee86b789f 100644 (file)
@@ -738,6 +738,7 @@ function lower_pieces(targets_todo: LowerTodoList):
   }
 
   while (nomove_heavy.length &&
+        (tomove_light.length || tomove_misstacked.length) &&
         nomove_heavy[nomove_heavy.length-1].p.z == q_z_top) {
     // Yowzer.  We have to reset the Z coordinates on these heavy
     // pieces, whose Z coordinate is the same as the stuff we are not