From b8388c391e8999c30c520672f08cca3b16f0f1da Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Fri, 26 Jan 2018 14:14:30 +0100 Subject: [PATCH] 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. --- backend.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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; } -- 1.7.0.4