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.
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);