X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=05af22bd8201f75fb9718382a3307eda68d5e976;hb=3512e2a362ede1907c75f89e3d6f5945414b46a5;hp=e014ebadd03ea9f1650355f0bda20d518bb71758;hpb=59129c40e6dd5df0ba1381723a28cd9c354e153f;p=xboard.git diff --git a/xboard.c b/xboard.c index e014eba..05af22b 100644 --- a/xboard.c +++ b/xboard.c @@ -5144,14 +5144,18 @@ void HandleUserMove(w, event, prms, nprms) x >= 0 && y >= 0) { ChessSquare fromP; ChessSquare toP; + int frc; /* Check if clicking again on the same color piece */ fromP = boards[currentMove][fromY][fromX]; toP = boards[currentMove][y][x]; - if ((WhitePawn <= fromP && fromP < WhiteKing && // [HGM] this test should go, as UserMoveTest now does it. - WhitePawn <= toP && toP <= WhiteKing) || // For now I made it less critical by exempting King - (BlackPawn <= fromP && fromP < BlackKing && // moves, to not interfere with FRC castlings. - BlackPawn <= toP && toP <= BlackKing)) { + frc = gameInfo.variant == VariantFischeRandom || gameInfo.variant == VariantCapaRandom; + if ((WhitePawn <= fromP && fromP <= WhiteKing && // [HGM] this test should go, as UserMoveTest now does it. + WhitePawn <= toP && toP <= WhiteKing && + !(fromP == WhiteKing && toP == WhiteRook && frc)) || + (BlackPawn <= fromP && fromP <= BlackKing && + BlackPawn <= toP && toP <= BlackKing && + !(fromP == BlackKing && toP == BlackRook && frc))) { /* Clicked again on same color piece -- changed his mind */ second = (x == fromX && y == fromY); if (appData.highlightDragging) {