From 8fe91362b308db43c4f597ce32f3a3b7588f706b Mon Sep 17 00:00:00 2001 From: Ilari Pihlajisto Date: Sun, 7 Mar 2010 14:19:28 +0200 Subject: [PATCH] Fix a bug in makeMove() Now the king won't disappear from the board if the source and target squares of a castling move are the same. --- src/chessboard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chessboard.cpp b/src/chessboard.cpp index 4626f5c..bac2ba0 100644 --- a/src/chessboard.cpp +++ b/src/chessboard.cpp @@ -269,7 +269,7 @@ void Board::makeMove(const Move& move) int rsource = rookSq[cside]; int rtarget = (cside == QueenSide) ? target + 1 : target -1; - if (rtarget == source) + if ((rtarget == source) || (target == source)) clearSource = false; m_squares[rsource] = NoPiece; m_squares[rtarget] = Rook * m_sign; -- 2.11.4.GIT