Suppress appearance of promotion popup when sweep-selecting
authorH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 18 Feb 2015 21:49:20 +0000 (22:49 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 7 May 2015 18:53:32 +0000 (20:53 +0200)
In highlight-induced promotions the popup would appear even when it
should have been off.

backend.c

index d8b85a1..ad78134 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -7732,7 +7732,7 @@ printf("(%d,%d)-(%d,%d) %d %d\n",fromX,fromY,toX,toY,x,y);
 
     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)) {
+    if (legal[toY][toX] == 2 && !appData.sweepSelect || 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) {