From 9b4c2f6e576b10ffb1ce3a08edc0bc2f7454bf41 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 9 Feb 2015 10:01:48 +0100 Subject: [PATCH] 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. --- backend.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 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) { -- 1.7.0.4