chiark / gitweb /
flip: Use description after flip, not before
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 15 Apr 2022 23:12:55 +0000 (00:12 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 15 Apr 2022 23:12:55 +0000 (00:12 +0100)
This makes the log messages about dice true.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
daemon/api.rs

index 27462cf25ee3c765c9d474b8a333bd8c85095ebe..2e9d0c66da3020b4a5c5665b1d7aae921d91f5c7 100644 (file)
@@ -597,12 +597,12 @@ api_route!{
 
           ("flip", wrc@ WRC::UpdateSvg) => {
             let nfaces = ipc.show(y).nfaces();
+            gpc.face = ((RawFaceId::from(gpc.face) + 1) % nfaces).into();
+            // todo: name the most visible aspect in the log ?
             let logents = log_did_to_piece(
               ioccults,&gs.occults,gpl,gpc,ipc,
               "flipped"
             )?;
-            // todo: name the most visible aspect in the log
-            gpc.face = ((RawFaceId::from(gpc.face) + 1) % nfaces).into();
             return ((
               wrc,
               PieceUpdateOp::Modify(()),