X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=3730e070ba0fe26a2187c9f7052c2d5d1c777f57;hb=1f0538d4e71f928ed4163cd5d39cba2d305cf685;hp=4974fed89370b31c76031fbac6d711b6cb421583;hpb=2fbce24cf46beda8a9049be879d5b82981ddf82d;p=xboard.git diff --git a/backend.c b/backend.c index 4974fed..3730e07 100644 --- a/backend.c +++ b/backend.c @@ -5527,7 +5527,12 @@ ParseOneMove (char *move, int moveNum, ChessMove *moveType, int *fromX, int *fro case BlackASideCastleFR: /* End of code added by Tord */ case IllegalMove: /* bug or odd chess variant */ - if(currentMoveString[1] == '@') goto drop; // illegal drop + if(currentMoveString[1] == '@') { // illegal drop + *fromX = *moveType == WhiteOnMove(moveNum) ? + (int) CharToPiece(ToUpper(currentMoveString[0])) : + (int) CharToPiece(ToLower(currentMoveString[0])); + goto drop; + } *fromX = currentMoveString[0] - AAA; *fromY = currentMoveString[1] - ONE; *toX = currentMoveString[2] - AAA; @@ -5551,10 +5556,10 @@ ParseOneMove (char *move, int moveNum, ChessMove *moveType, int *fromX, int *fro case WhiteDrop: case BlackDrop: - drop: *fromX = *moveType == WhiteDrop ? (int) CharToPiece(ToUpper(currentMoveString[0])) : (int) CharToPiece(ToLower(currentMoveString[0])); + drop: *fromY = DROP_RANK; *toX = currentMoveString[2] - AAA; *toY = currentMoveString[3] - ONE; @@ -7551,7 +7556,7 @@ printf("to click %d,%d\n",x,y); else gatingPiece = doubleClick ? fromP : EmptySquare; fromX = x; fromY = y; dragging = 1; - ReportClick("lift", x, y); + if(!second) ReportClick("lift", x, y); MarkTargetSquares(0); DragPieceBegin(xPix, yPix, FALSE); if(appData.sweepSelect && CanPromote(piece = boards[currentMove][y][x], y)) { @@ -7574,7 +7579,7 @@ printf("A type=%d\n",clickType); return; } - if (clickType == Release && x == fromX && y == fromY && killX < 0) { + if (clickType == Release && x == fromX && y == fromY && killX < 0 && !sweepSelecting) { DragPieceEnd(xPix, yPix); dragging = 0; if(clearFlag) { // a deferred attempt to click-click move an empty square on top of a piece @@ -7588,10 +7593,9 @@ printf("A type=%d\n",clickType); /* Undo animation damage if any */ DrawPosition(FALSE, NULL); } - if (second || sweepSelecting) { + if (second) { /* Second up/down in same square; just abort move */ - if(sweepSelecting) DrawPosition(FALSE, boards[currentMove]); - second = sweepSelecting = 0; + second = 0; fromX = fromY = -1; gatingPiece = EmptySquare; MarkTargetSquares(1); @@ -7728,7 +7732,7 @@ printf("(%d,%d)-(%d,%d) %d %d\n",fromX,fromY,toX,toY,x,y); if(legal[toY][toX] == 2) promoChoice = ToLower(PieceToChar(defaultPromoChoice)); // highlight-induced promotion - if (legal[toY][toX] == 2 || HasPromotionChoice(fromX, fromY, toX, toY, &promoChoice, appData.sweepSelect)) { + if (legal[toY][toX] == 2 && !appData.sweepSelect || HasPromotionChoice(fromX, fromY, toX, toY, &promoChoice, appData.sweepSelect)) { SetHighlights(fromX, fromY, toX, toY); MarkTargetSquares(1); if(gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat || gameInfo.variant == VariantGrand) {