From: H.G. Muller Date: Thu, 12 Apr 2012 22:33:28 +0000 (+0200) Subject: Fix click-click sweep promotions to empty square X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=8f331d8de1bad648f7a7069b8d0da3697f723e3d;p=xboard.git Fix click-click sweep promotions to empty square These did not work, because DragPieceBegin would fail on an EmptySquare. --- diff --git a/backend.c b/backend.c index bd2a2c7..a2ff648 100644 --- a/backend.c +++ b/backend.c @@ -7190,7 +7190,10 @@ LeftClick (ClickType clickType, int xPix, int yPix) if(HasPromotionChoice(fromX, fromY, toX, toY, &promoChoice, FALSE)) { if(appData.sweepSelect) { ChessSquare piece = boards[currentMove][fromY][fromX]; + ChessSquare victim = boards[currentMove][toY][toX]; + boards[currentMove][toY][toX] = piece; // kludge: make sure there is something to grab for drag DragPieceBegin(xPix, yPix, TRUE); dragging = 1; + boards[currentMove][toY][toX] = victim; promoSweep = defaultPromoChoice; if(PieceToChar(PROMOTED piece) == '+') promoSweep = PROMOTED piece; selectFlag = 0; lastX = xPix; lastY = yPix;