From: H.G.Muller Date: Wed, 4 May 2016 13:18:34 +0000 (+0200) Subject: Fix deferral on sweep promotions X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=d0955e6b0d0f5a00a65ed05a14fd8fa73121ab3c;p=xboard.git Fix deferral on sweep promotions When a sweep in the to-square due to a highlight-induced promotion had left the original piece as choice, the piece would be considered to promote to itself (i.e. the move would get the promoChar for its piece type), rather than to not promote at all. Some engines choked on this (HaChu). Now such a move is not considered a promotion. --- diff --git a/backend.c b/backend.c index b7aafee..0c12671 100644 --- a/backend.c +++ b/backend.c @@ -7898,7 +7898,10 @@ LeftClick (ClickType clickType, int xPix, int yPix) if(gatingPiece != EmptySquare && gameInfo.variant == VariantSChess) promoChoice = ToLower(PieceToChar(gatingPiece)); - if(legal[toY][toX] == 2) promoChoice = ToLower(PieceToChar(defaultPromoChoice)); // highlight-induced promotion + if(legal[toY][toX] == 2) { // highlight-induced promotion + if(piece == defaultPromoChoice) promoChoice = NULLCHAR; // deferral + else promoChoice = ToLower(PieceToChar(defaultPromoChoice)); + } if (legal[toY][toX] == 2 && !appData.sweepSelect || HasPromotionChoice(fromX, fromY, toX, toY, &promoChoice, appData.sweepSelect)) { SetHighlights(fromX, fromY, toX, toY);