From: H.G.Muller Date: Mon, 9 Feb 2015 09:01:48 +0000 (+0100) Subject: Fix highlight-induced promotions X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=9b4c2f6e576b10ffb1ce3a08edc0bc2f7454bf41;p=xboard.git Fix highlight-induced promotions A purple square in the highlight color FEN triggered the promotion procedure, but the chosen promotion piece would not be suffixed to the move. --- diff --git a/backend.c b/backend.c index 674a9d3..7747844 100644 --- a/backend.c +++ b/backend.c @@ -7726,7 +7726,9 @@ printf("(%d,%d)-(%d,%d) %d %d\n",fromX,fromY,toX,toY,x,y); if(gatingPiece != EmptySquare && gameInfo.variant == VariantSChess) promoChoice = ToLower(PieceToChar(gatingPiece)); - if (HasPromotionChoice(fromX, fromY, toX, toY, &promoChoice, appData.sweepSelect)) { + 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)) { SetHighlights(fromX, fromY, toX, toY); MarkTargetSquares(1); if(gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat || gameInfo.variant == VariantGrand) {