Fix a longstanding bug reported by Andreas Ruider. A typo in the code
authorTim Mann <tim@tim-mann.org>
Tue, 15 Feb 2005 05:43:09 +0000 (05:43 +0000)
committerTim Mann <tim@tim-mann.org>
Tue, 15 Feb 2005 05:43:09 +0000 (05:43 +0000)
caused a bug where we didn't test for Black castling into check on the
queenside.

moves.c

diff --git a/moves.c b/moves.c
index bed2064..1a0522f 100644 (file)
--- a/moves.c
+++ b/moves.c
@@ -516,7 +516,7 @@ int GenLegal(board, flags, epfile, callback, closure)
            board[7][0] == BlackRook &&
            (ignoreCheck ||
             (!CheckTest(board, flags, 7, ff, 7, ff - 1, FALSE) &&
-             !CheckTest(board, flags, 7, ff, 7, ff - 1, FALSE)))) {
+             !CheckTest(board, flags, 7, ff, 7, ff - 2, FALSE)))) {
 
            callback(board, flags,
                     ff==4 ? BlackQueenSideCastle : BlackQueenSideCastleWild,