chiark / gitweb /
at-otter hidden: Update when we move (specific, must generalise)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Mar 2021 20:35:53 +0000 (20:35 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Mar 2021 20:36:41 +0000 (20:36 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/at-otter.rs

index 069ffeda74e0d4f41bc8dedfa280082a43d0ce55..12fbf507ffdf7311cee5bbe110228c53f1d3eab1 100644 (file)
@@ -512,9 +512,10 @@ impl Ctx {
     }
 
     for (xi, &p) in a_pawns.iter().enumerate().take(1) {
-      alice.api_with_piece_op_synch(&mut a_pieces, p, "m", json![
-        [ (xi+1) * 15, 20 ]
-      ])?;
+      let xix: Coord = xi.try_into().unwrap();
+      let pos = PosC([ (xix + 1) * 15, 20 ]);
+      a_pieces[p].pos = pos;
+      alice.api_with_piece_op_synch(&mut a_pieces, p, "m", json![pos.0])?;
     }
 
     alice.synchu(&mut a_pieces)?;