From 2152ee2f0a07006d12f66a2a1be2b17f9c8994d6 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 2 Feb 2014 10:40:18 +0100 Subject: [PATCH] Fix Seirawan reverse-castling animation In Chess960 animation of castlings is suppressed, because the move is encoded as KxR, so that the to-square in general is not the final destination of the King. So it is just confusing to the eye to see the King slide to the Rook, and then jump to an entirely different square. In S-Chess castlings can similarly be encoded as RxK (to indicate gating at the Rook square), and animation of those moves should be suppressed for the same reason. But it wasn't, and in Fischer castlings denoted as RxK this even caused the Rook to disappear when it didn't need to moved. Perhaps one day a smart method of animating Fischer castlings can be designed. (E.g. remove Rook, animate King move to true to-square, place Rook? But what if the King doesn't move at all? Animate Rook then? Normal castlings now animate the King, and then just displace the Rook.) --- board.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/board.c b/board.c index abd2a68..d0f6cfb 100644 --- a/board.c +++ b/board.c @@ -611,7 +611,9 @@ AnimateMove (Board board, int fromX, int fromY, int toX, int toY) return; if(board[toY][toX] == WhiteRook && board[fromY][fromX] == WhiteKing || - board[toY][toX] == BlackRook && board[fromY][fromX] == BlackKing) + board[toY][toX] == BlackRook && board[fromY][fromX] == BlackKing || + board[toY][toX] == WhiteKing && board[fromY][fromX] == WhiteRook || // [HGM] seirawan + board[toY][toX] == BlackKing && board[fromY][fromX] == BlackRook) return; // [HGM] FRC: no animtion of FRC castlings, as to-square is not true to-square if (fromY < 0 || fromX < 0 || toX < 0 || toY < 0) return; -- 1.7.0.4