From f91aa93d9b3e15a37861720e1a0fbb0fbe83215a Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 18 Apr 2015 11:09:34 +0200 Subject: [PATCH] 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. --- moves.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) 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) { -- 1.7.0.4