From d0955e6b0d0f5a00a65ed05a14fd8fa73121ab3c Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 4 May 2016 15:18:34 +0200 Subject: [PATCH] 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. --- backend.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) 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); -- 1.7.0.4