From: H.G.Muller Date: Fri, 26 Jan 2018 13:14:30 +0000 (+0100) Subject: Fix promoting pieces in Shogi X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=b8388c391e8999c30c520672f08cca3b16f0f1da;p=xboard.git Fix promoting pieces in Shogi Because of a bug in a boolean expression the Gold had become a promoting piece. The promotion procedure on user moves is now only triggered if the piece itself was not defined as promoted, AND its partner is defined as promoted. --- diff --git a/backend.c b/backend.c index e0f60b4..0e04a16 100644 --- a/backend.c +++ b/backend.c @@ -6746,7 +6746,7 @@ HasPromotionChoice (int fromX, int fromY, int toX, int toY, char *promoChoice, i } else if(gameInfo.variant == VariantShogi) { promotionZoneSize = (BOARD_HEIGHT- deadRanks)/3 +(BOARD_HEIGHT == 8); highestPromotingPiece = (int)WhiteAlfil; - if(PieceToChar(piece) != '+' || PieceToChar(CHUPROMOTED(piece)) == '+') highestPromotingPiece = piece; + if(PieceToChar(piece) != '+' && PieceToChar(CHUPROMOTED(piece)) == '+') highestPromotingPiece = piece; } else if(gameInfo.variant == VariantMakruk || gameInfo.variant == VariantGrand || gameInfo.variant == VariantChuChess) { promotionZoneSize = 3; }