chiark / gitweb /
script: Make non-moveable pieces bottom, when lowerint
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 5 Jul 2021 22:23:58 +0000 (23:23 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 6 Jul 2021 00:24:15 +0000 (01:24 +0100)
This avoids lowering pieces below the hand they are in, etc.

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

index 933781b51fffb1258b66f0ba0fc481467ca6ceb5..5c45c7a1f9231ceb9f3ee67305736ec523c19298 100644 (file)
@@ -565,7 +565,7 @@ type LowerTodoList = { [piece: string]: LowerTodoItem };
 keyops_local['lower'] = function (uo: UoRecord) { lower_targets(uo); }
 
 function lower_treat_bottom(p: PieceInfo): boolean {
-  return wresting || p.pinned;
+  return wresting || p.pinned || p.moveable == "No";
 }
 
 function lower_targets(uo: UoRecord): boolean {