From: H.G.Muller Date: Sat, 18 Apr 2015 09:09:34 +0000 (+0200) Subject: Allow promotion to piece with letter ID in Chu X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=f91aa93d9b3e15a37861720e1a0fbb0fbe83215a;p=xboard.git Allow promotion to piece with letter ID in Chu Normally all promoted versions in Chu have ID '+', but it could be useful to allow piece promotion always, as long as the promoted piece participates. --- diff --git a/moves.c b/moves.c index a66c2e0..8b04b53 100644 --- a/moves.c +++ b/moves.c @@ -1829,7 +1829,10 @@ LegalityTest (Board board, int flags, int rf, int ff, int rt, int ft, int promoC if(cl.kind != NormalMove || promoChar == NULLCHAR || promoChar == '=') return cl.kind; if(promoChar != '+') return CharToPiece(promoChar) == EmptySquare ? ImpossibleMove : IllegalMove; - if(PieceToChar(CHUPROMOTED board[rf][ff]) != '+') return ImpossibleMove; + if(PieceToChar(CHUPROMOTED board[rf][ff]) != '+') { + if(PieceToChar(CHUPROMOTED (board[rf][ff] < BlackPawn ? WhitePawn : BlackPawn)) != '.') + return ImpossibleMove; + } return flags & F_WHITE_ON_MOVE ? WhitePromotion : BlackPromotion; } else if(gameInfo.variant == VariantShogi) {